Imagining there is Observable A emitting
a1, a2, a3, a4...
A.flatMap(a -> f(a))
will emit items in unpredictable order, for example:
fa3, fa1, fa2, fa4...
How could I get results in order like below?
fa1, fa2, fa3, fa4...
ConcatMap
can return the result I want, but it processes streams in sequential order, which is not effective in time consuming.
I need something like concatMap with parallel processing ability. Any solution? Thanks.