Brief memo with RxJava2 data source usages. Little, clearly, smart.

Observable

Standard data source. Does not support backpressure.

If you wish, you can unsubscribe by disposable.dispose()

Flowable

The same, but with backpressure support:

Single

Receives one data block, without any onNext:

Completable

Runs something to execute and waits for the result. Update data on the server, write to the database, etc. :

Maybe

Mix of Single and Completable. If something is returned – well, it is given in onSuccess. Nothing returned – just execute the code in onComplete:

Leave a Reply

Close Menu