java.lang.Object
mutiny.zero.operators.Spread<T,R>
- Type Parameters:
T- the upstream item typeR- the downstream (flattened) item type
- All Implemented Interfaces:
Flow.Publisher<R>
A
Flow.Publisher that maps each upstream item to a Flow.Publisher and flattens the results
with bounded concurrency.
With concurrency = 1 this behaves as a concatMap (strict ordering).
With concurrency > 1 items from different inner publishers may interleave.
-
Constructor Summary
ConstructorsConstructorDescriptionSpread(Flow.Publisher<T> upstream, Function<T, @Nullable Flow.Publisher<R>> mapper, int concurrency, int prefetch) Create a new spread (flatMap) publisher. -
Method Summary
-
Constructor Details
-
Spread
public Spread(Flow.Publisher<T> upstream, Function<T, @Nullable Flow.Publisher<R>> mapper, int concurrency, int prefetch) Create a new spread (flatMap) publisher.- Parameters:
upstream- the upstream publisher, must not benullmapper- the mapping function, must not benullconcurrency- the maximum number of concurrent inner subscriptions, must be positiveprefetch- the per-inner request batch size, must be positive
-
-
Method Details
-
subscribe
- Specified by:
subscribein interfaceFlow.Publisher<T>
-