I'm confused by prefetch parameter from concatMap which basically sounds like MAX_CONCURRENCY.
prefetch: the number of elements to prefetch from the current Observable
Q1: Does it mean to prefetch elements from Observable for mapping and then subscribe one at a time in order?
e.g, the docs for concatMapSingle is pretty clear:
Maps the upstream items into SingleSources and subscribes to them one after the other succeeds, emits their success values or terminates immediately if either this Observable or the current inner SingleSource fail.
Q2: Is it true that doc for concatMap can be reworded as:
Maps the upstream items into ObservableSources and subscribes to them one after the other completes?
The original version of a doc for concatMap:
Returns a new Observable that emits items resulting from applying a function that you supply to each item emitted by the source ObservableSource, where that function returns an ObservableSource, and then emitting the items that result from concatenating those resulting ObservableSources.
i.e., the following lines are basically the same (in terms of MAX_CONCURRENCY)?
int MAX_CONCURRENCY = 1;
Observable.just(1, 2, 3).flatMap(num -> Observable.just(num), false, MAX_CONCURRENCY);
Observable.just(1, 2, 3).concatMap(num -> Observable.just(num));