Appendix B. A Decision Tree of Observable Operators
This appendix aims to help you find the appropriate operator from the RxJava universe. With more than a hundred possible options, it is getting increasingly complex to find a built-in operator that suits our needs best. The content of this appendix is entirely copied from the official RxJava documentation, A Decision Tree of Observable Operators, under Apache License Version 2.0. However, back references lead to proper chapters in the book rather than online documentation. Most often there is an entire chapter covering a given operator; sometimes there is just a brief mention or example.
-
I want to create a new
Observable
…-
that emits a particular item
just()
, see “Creating Observables”…-
that was returned from a function called at subscribe-time:
start()
, seerxjava-async
module. -
that was returned from an
Action
,Callable
,Runnable
, or something of that sort, called at subscribe-time:from()
,fromCallable()
,:fromRunnable()
, see “Creating Observables” and “Infinite Streams”. -
after a specified delay:
timer()
, see “Timing: timer() and interval()”.
-
-
that pulls its emissions from a particular
Array
,Iterable
, or something like that:from()
, see “Creating Observables”. -
by retrieving it from a future:
from()
, see “Creating Observables” and “CompletableFuture and Streams”. -
that obtains its sequence from a Future:
from()
, see “Creating Observables”. -
that emits a sequence of items repeatedly:
repeat()
, see “Reusing Operators ...
-
Get Reactive Programming with RxJava now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.