xchange-stream icon indicating copy to clipboard operation
xchange-stream copied to clipboard

Replacing RxJava's Observable by Flowable

Open sanderdg opened this issue 6 years ago • 3 comments

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!

sanderdg avatar Mar 29 '18 05:03 sanderdg

+1 to this. Financial streaming data is a textbook example of the benefits of a backpressure supported stream, like Flowable

caleb-allen avatar Mar 29 '18 21:03 caleb-allen

Sound reasonable, are there any benefits to just calling io.reactivex.Observable#toFlowable?

davidjirovec avatar Mar 29 '18 21:03 davidjirovec

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().

badgerwithagun avatar May 27 '18 17:05 badgerwithagun