Skip to content

Commit 51b735a

Browse files
committed
more README on blocking / non blocking
1 parent ba22eae commit 51b735a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,16 @@ Otherwise, let it flow to the first wait-all component. That will naturally "blo
193193
The advantage of streaming all the way (when all the components, from HTTP to database, in our simple example, are streaming to the level/granularity say of sayy batches of 1000 students, not more),
194194
then the application is more elastic since it consumes a limited amount of memory per request, and even a constant amount of it!
195195

196-
196+
So back to the steps of refactoring,
197+
1. Put Observable in signatures
198+
2. set observable.subscribeOn and observable.observeOn(scheduler) to move blocking computations (e.g. JDBC calls) to a different thread pool
199+
3. Make it async: use Spring MVC async
200+
4. Make the backend non-blocking: use a specialized library for your database that implements a non blocking alternate implementation
201+
4'. Wrap that non blocking implementation in RxJava or your preferred reactive framework, if not already wrapped in it, like in our case
202+
5. Make it streaming: use Vert.x
203+
6. Do the writes
204+
7. Do the (multi-statement) transactions
205+
8. Maybe some error handling
197206

198207
To run the app
199208

0 commit comments

Comments
 (0)