3.x: Add concatMap with Scheduler guaranteeing where the mapper runs by akarnokd · Pull Request #6538 · ReactiveX/RxJava (original) (raw)

This PR adds an overload to concatMap and concatMapDelayError in both Flowable and Observable which makes sure the mapper function is always executed on a dedicated scheduler.

By default concatMap may execute the mapper function on various threads: the subscribing thread, the upstream thread generating the items to be mapped or the thread where the generated inner source terminates. These overloads remove this kind of uncertainty.

The implementation is a copy of the original concatMap instead of an extension so that optimizations for the non-scheduled variants still work without extra overhead.

Overloads to the concatMap{Single|Maybe|Completable} and concatMap{Single|Maybe|Completable}DelayError may be added in a separate PR later.

Resolves #6447