mapAsyncPartitioned
Pass incoming elements to a partitioning function that returns a partition result for each element and then to a processing function that returns a Future
result. The resulting Source or Flow will have elements that retain the order of the original Source or Flow.
Signature¶
Source.mapAsyncPartitioned
Flow.mapAsyncPartitioned
Description¶
Like mapAsync
but an intermediate partitioning stage is used. Up to parallelism
elements can be processed concurrently, but regardless of their completion time the incoming order will be kept when results complete. For use cases where order does not matter, mapAsyncPartitionedUnordered
can be used.
Reactive Streams semantics¶
emits when the next in order Future
returned by the provided function completes successfully
backpressures when downstream backgpressures and completed and incomplete Future
has reached the configured parallelism
completes when upstream completes and all Futures have completed and all results have been emitted