xchange-stream
xchange-stream copied to clipboard
Replacing RxJava's Observable by Flowable
Throughout the source the Observable
class is used but actually Flowable
should be used instead to prevent out of memory exceptions and allow for backpressure support. According to the documentation it should be used when (amongst other things) one of the following is applicable:
- Potentially 10k+ of elements (ticker data for sure).
- Network (Streaming) IO that requests a logical amount.
It shouldn't be to much work to change this. Thanks for this great project!
+1 to this. Financial streaming data is a textbook example of the benefits of a backpressure supported stream, like Flowable
Sound reasonable, are there any benefits to just calling io.reactivex.Observable#toFlowable
?
Do you really want xchange-stream specifying its own backpressure strategy? What if xchange-stream decides LATEST
and I want DROP
?
As @davidjirovec suggests, I usually just use toFlowable()
.