Types of Observables in RxJava

This is a short reminder about Observable types in RxJava.

Observable is the simplest Observable which can emit more than one value.

Flowable is a Observable which can emit huge numbers of values which can’t be consumed by the Observer.

Single is a Observable which can emit only one value like a response from a network call.

Maybe is a Observable which can emit a value or no value.

Completable is a Observable which has to do some task without emitting a value

Observable type Number of values Handlers
Observable 1 or more onNext, onError or onComplete
Flowable Many with backpressure support onNext, onError or onComplete
Single 1 onSuccess or onError
Maybe 1 or nothing onSuccess, or onComplete, or onError
Completable No values onError or onComplete

 

References

 

About ysden123

We are not only for work... All my time free from work I spend on photography. Most photos are from our travels. I like make photos in still life style as well.
This entry was posted in java, Programming, rxjava and tagged , , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.