Open fmcarvalho opened 2 years ago
Lets assume that we do not have control on a publisher data flux, so we have no way of throttling publisher behaviour. In oreilly course and in documentation avalailable, i saw 4 main strategies to deal with backpressure: buffering (e.g. using buffer()
method), batching (e.g. using window()
), sampling with (e.g. sample()
) and dropping, provided for example by onBackpressureDrop()
or onBackpressureBuffer()
. I see the danger of computational resources overflow or possible data lose in all of these strategies, so my question is: what we do if we cannot discard any data and we have limited resources? Are the use of batch strategies allied with multithreaded schedulers the best way to deal with a very high rate publisher?
Those are important features, but we are not going to deal with them. That said, you should understand those problems exist, and have a slight idea of them, but you will not dig through on.
This series of videos are from the same author of the book "Modern Java in Action" of MPD Isel course.
It gives a good insight about Reactive Streams. You may start directly on section "Programming Reactive Streams with RxJava":
The official site of ReactiveX also has a lot of resources: http://reactivex.io/
Or you may start before on:
Do not read 3. Programming Actors with Akka. Out of the scope.
All of this is also on Part 5 of the book "Modern Java in Action".