These are chat archives for ReactiveX/RxJava
RxJava – Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.
@mlatu Why do you need map+filter? Just filter can already do the filtering and possible data manipulations (just nothing persistent).
flatMap is for one to many tranformations, map for one to one.
About preserving order, do you really need that in a reactive system? concatMap also evaluate everything serial i think, flatMap has the possibility to go concurrent if you need it.
o.map( x -> f(x)).filter(x -> x != null)
o.flatMap(x -> y = f(x); y != null ? Observable.just(y) : Observable.empty())
Observable.range(10000000)./* map or flatmap */.subscribe(() -> endMeasure())
o.flatMap(x -> Observalbe.just(f(x)).filter(y -> y != null) )
mapis still cleaner.