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 CompletionStage result. The resulting Source or Flow will have elements that retain the order of the original Source or Flow.
Signature
Source.mapAsyncPartitionedSource.mapAsyncPartitioned Flow.mapAsyncPartitionedFlow.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 CompletionStage returned by the provided function completes successfully
backpressures when downstream backgpressures and completed and incomplete Future CompletionStage has reached the configured parallelism
completes when upstream completes and all Futures CompletionStages have completed and all results have been emitted