'groups').
Use from to start processing a regular Publisher in 'rails', which each
cover a subset of the original Publisher's data. Flux#parallel() is a
convenient shortcut to achieve that on a Flux.
Use runOn to introduce where each 'rail' should run on thread-wise.
Use sequential to merge the sources back into a single Flux.
Use then to listen for all rails termination in the produced Mono
subscribe(Subscriber) if you simply want to subscribe to the merged sequence.
Note that other variants like subscribe(Consumer) instead do multiple
subscribes, one on each rail (which means that the lambdas should be as stateless and
side-effect free as possible).
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final < the output value type U> U | Returns: the value returned by the converter functionthe converter function from converter)ParallelFlux to some typePerform a fluent transformation to a value via a converter function which receives this ParallelFlux. |
| public final ParallelFlux | Returns: the assembly tracingParallelFluxActivate traceback (full assembly tracing) for this particular |
| public final ParallelFlux | Returns: the assembly markedParallelFluxa unique enough description to include in the light assembly traceback. description)Activate traceback (assembly marker) for this particular |
| public final ParallelFlux | Returns: the assembly markedParallelFlux.a description (must be unique enough if forceStackTrace is set
to false). description, boolean false to make a light checkpoint without a stacktrace, true
to use a stack trace. forceStackTrace)Activate traceback (full assembly tracing or the lighter assembly marking depending on the
|
| public final < the collection type C> ParallelFlux | Returns: the newParallelFlux instancethe supplier of the collection in each rail collectionSupplier, BiConsumer<? super C, ? super T> the collector, taking the per-rail collection and the current
item collector)Collect the elements in each rail into a collection supplied via a collectionSupplier and collected into with a collector action, emitting the collection at the end. |
| public final Mono | Returns: the new Flux instancethe comparator to compare elements comparator)Sorts the 'rails' according to the comparator and returns a full sorted list as a Publisher. |
| public final Mono | Returns: the new Mono instancethe comparator to compare elements comparator, int the expected number of total elements capacityHint)Sorts the 'rails' according to the comparator and returns a full sorted list as a Publisher. |
| public final < the result type R> ParallelFlux | Returns: the newParallelFlux instancethe function to map each rail's value into a Publisher source and the
inner Publishers (immediate, boundary, end) mapper)Generates and concatenates Publishers on each 'rail', signalling errors immediately and generating 2 publishers upfront. |
| public final < the result type R> ParallelFlux | Returns: the newParallelFlux instancethe function to map each rail's value into a Publisher mapper, int the number of items to prefetch from each inner Publisher source
and the inner Publishers (immediate, boundary, end) prefetch)Generates and concatenates Publishers on each 'rail', signalling errors immediately and using the given prefetch amount for generating Publishers upfront. |
| pack-priv final < the result type R> ParallelFlux | Returns: the newParallelFlux instancethe function to map each rail's value into a Publisher mapper, int the number of items to prefetch from each inner Publisher prefetch, FluxConcatMap.the error handling, i.e., when to report errors from the main
source and the inner Publishers (immediate, boundary, end) errorModeGenerates and concatenates Publishers on each 'rail', optionally delaying errors and using the given prefetch amount for generating Publishers upfront. |
| public final < the result type R> ParallelFlux | Returns: the newParallelFlux instancethe function to map each rail's value into a Publisher
source and the inner Publishers (immediate, boundary, end) mapper)Generates and concatenates Publishers on each 'rail', delaying errors and generating 2 publishers upfront. |
| pack-priv final < the result type R> ParallelFlux | Returns: the newParallelFlux instancethe function to map each rail's value into a Publisher mapper, boolean true if delayed until all sources are concatenated delayUntilEnd, int the number of items to prefetch from each inner Publisher
source and the inner Publishers (immediate, boundary, end) prefetch)Generates and concatenates Publishers on each 'rail', delaying errors and using the given prefetch amount for generating Publishers upfront. |
| pack-priv final < the result type R> ParallelFlux | Returns: the newParallelFlux instancethe function to map each rail's value into a Publisher mapper, int the number of items to prefetch from each inner Publisher
source and the inner Publishers (immediate, boundary, end) prefetch)Generates and concatenates Publishers on each 'rail', delaying errors and using the given prefetch amount for generating Publishers upfront. |
| public final ParallelFlux | Returns: the newParallelFlux instancethe callback afterTerminate)Run the specified runnable when a 'rail' completes or signals an error. |
| public final ParallelFlux | Returns: the newParallelFlux instancethe callback onCancel)Run the specified runnable when a 'rail' receives a cancellation. |
| public final ParallelFlux | Returns: the newParallelFlux instancethe callback onComplete)Run the specified runnable when a 'rail' completes. |
| public final ParallelFlux | Returns: an observedParallelFluxthe mandatory callback to call on
signalConsumer)Subscriber#onNext(Object), Subscriber#onError(Throwable) and
Subscriber#onComplete()Triggers side-effects when the |
| public final ParallelFlux | Returns: the newParallelFlux instancethe callback onError)Call the specified consumer with the exception passing through any 'rail'. |
| public final ParallelFlux | Returns: the newParallelFlux instancethe callback onNext)Call the specified consumer with the current element passing through any 'rail'. |
| public final ParallelFlux | Returns: the newParallelFlux instancethe callback onRequest)Call the specified consumer with the request amount if any rail receives a request. |
| pack-priv static <T> ParallelFlux | doOnSignal(ParallelFlux<T> source, Consumer<? super T> onNext, Consumer<? super T> onAfterNext, Consumer<? super Throwable> onError, Runnable onComplete, Runnable onAfterTerminate, Consumer<? super Subscription> onSubscribe, LongConsumer onRequest, Runnable onCancel)
|
| public final ParallelFlux | Returns: the newParallelFlux instancethe callback onSubscribe)Call the specified callback when a 'rail' receives a Subscription from its upstream. |
| public final ParallelFlux | Returns: an observedParallelFluxthe callback to call on onTerminate)Subscriber#onComplete or Subscriber#onErrorTriggered when the |
| public final ParallelFlux | Returns: the newParallelFlux instancethe function returning true to keep a value or false to drop a
value predicate)Filters the source values on each 'rail'. |
| public final < the result type R> ParallelFlux | Returns: the newParallelFlux instancethe function to map each rail's value into a Publisher mapper)Generates and flattens Publishers on each 'rail'. |
| public final < the result type R> ParallelFlux | Returns: the newParallelFlux instancethe function to map each rail's value into a Publisher mapper, boolean should the errors from the main and the inner sources delayed
till everybody terminates? delayError)Generates and flattens Publishers on each 'rail', optionally delaying errors. |
| public final < the result type R> ParallelFlux | Returns: the newParallelFlux instancethe function to map each rail's value into a Publisher mapper, boolean should the errors from the main and the inner sources delayed
till everybody terminates? delayError, int the maximum number of simultaneous subscriptions to the
generated inner Publishers maxConcurrency)Generates and flattens Publishers on each 'rail', optionally delaying errors and having a total number of simultaneous subscriptions to the inner Publishers. |
| public final < the result type R> ParallelFlux | Returns: the newParallelFlux instancethe function to map each rail's value into a Publisher mapper, boolean should the errors from the main and the inner sources delayed
till everybody terminates? delayError, int the maximum number of simultaneous subscriptions to the
generated inner Publishers maxConcurrency, int the number of items to prefetch from each inner Publisher prefetch)Generates and flattens Publishers on each 'rail', optionally delaying errors, having a total number of simultaneous subscriptions to the inner Publishers and using the given prefetch amount for the inner Publishers. |
| pack-priv static <T> ParallelFlux | |
| public static < the value type T> ParallelFlux | Returns: theParallelFlux instancethe source Publisher source)Take a Publisher and prepare to consume it on multiple 'rails' (one per CPU core) in a round-robin fashion. |
| public static < the value type T> ParallelFlux | Returns: the newParallelFlux instancethe source Publisher source, int the number of parallel rails parallelism)Take a Publisher and prepare to consume it on |
| public static < the value type T> ParallelFlux | Returns: the newParallelFlux instancethe source Publisher source, int the number of parallel rails parallelism, int the number of values to prefetch from the source prefetch, Supplier<Queue<T>> the queue structure supplier to hold the prefetched values
from the source until there is a rail ready to process it. queueSupplier)Take a Publisher and prepare to consume it on |
| public static < the value type T> ParallelFlux | Returns: the newParallelFlux instancethe array of publishers publishers)Wraps multiple Publishers into a |
| public int | Returns: the prefetch configuration of the componentThe prefetch configuration of the component |
| public final Flux | Returns: the new Flux instanceExposes the 'rails' as individual GroupedFlux instances, keyed by the rail index (zero based). |
| public final ParallelFlux | |
| public final ParallelFlux | Returns: a new unalteredParallelFluxObserve all Reactive Streams signals and use |
| public final ParallelFlux | Returns: a new unalteredParallelFluxto be mapped into logger configuration (e.g. org.springframework
.reactor). If category ends with "." like "reactor.", a generated operator suffix
will complete, e.g. "reactor.Parallel.Map". category)Observe all Reactive Streams signals and use |
| public final ParallelFlux | Returns: a new unalteredParallelFluxto be mapped into logger configuration (e.g. org.springframework
.reactor). If category ends with "." like "reactor.", a generated operator
suffix will complete, e.g. "reactor.Parallel.Map". category, Level the level, SignalType... Level to enforce for this tracing ParallelFlux (only
FINEST, FINE, INFO, WARNING and SEVERE are taken into account)a vararg options)SignalType option to filter log messagesObserve Reactive Streams signals matching the passed filter |
| public final ParallelFlux | Returns: a new unalteredParallelFluxto be mapped into logger configuration (e.g. org.springframework
.reactor). If category ends with "." like "reactor.", a generated operator
suffix will complete, e.g. "reactor.ParallelFlux.Map". category, Level the level, boolean Level to enforce for this tracing ParallelFlux (only
FINEST, FINE, INFO, WARNING and SEVERE are taken into account)capture the current stack to display operator
class/line number. showOperatorLine, SignalType... a vararg options)SignalType option to filter log messagesObserve Reactive Streams signals matching the passed filter |
| public final < the output value type U> ParallelFlux | Returns: the newParallelFlux instancethe mapper function turning Ts into Us. mapper)Maps the source values on each 'rail' to another value. |
| public final ParallelFlux | Returns: the same sequence, but bearing a namea name for the sequence name)Give a name to this sequence, which can be retrieved using |
| protected static < the value type T> ParallelFlux | Returns: the potentially wrapped sourcethe source to wrap source)Invoke |
| public final Flux | Returns: the new Flux instancethe comparator to choose the smallest value available from all rails comparator)Merges the values from each 'rail', but choose which one to merge by way of a
provided |
| public final Flux | Returns: the new Flux instancethe comparator to choose the smallest value available from all rails comparator, int the prefetch to use prefetch)Merges the values from each 'rail', but choose which one to merge by way of a
provided |
| public abstract int | Returns: the number of expected parallel SubscribersReturns the number of expected parallel Subscribers. |
| public final Mono | Returns: the new Mono instance emitting the reduced value or empty if theParallelFlux was emptythe function to reduce two values into one. reducer)Reduces all values within a 'rail' and across 'rails' with a reducer function into a single sequential value. |
| public final < the reduced output type R> ParallelFlux | Returns: the newParallelFlux instancethe supplier for the initial value initialSupplier, BiFunction<R, ? super T, R> the function to reduce a previous output of reduce (or the initial
value supplied) with a current source value. reducer)Reduces all values within a 'rail' to a single value (with a possibly different type) via a reducer function that is initialized on each rail from an initialSupplier value. |
| public final ParallelFlux | Returns: the newParallelFlux instancethe scheduler to use scheduler)Specifies where each 'rail' will observe its incoming values with possible work-stealing and default prefetch amount. |
| public final ParallelFlux | Returns: the newParallelFlux instancethe scheduler to use that rail's worker has run out of work. scheduler, int the number of values to request on each 'rail' from the source prefetch)Specifies where each 'rail' will observe its incoming values with possible work-stealing and a given prefetch amount. |
| public final Flux | Returns: the new Flux instanceMerges the values from each 'rail' in a round-robin or same-order fashion and exposes it as a regular Publisher sequence, running with a default prefetch value for the rails. |
| public final Flux | Returns: the new Flux instancethe prefetch amount to use for each rail prefetch)Merges the values from each 'rail' in a round-robin or same-order fashion and exposes it as a regular Publisher sequence, running with a give prefetch value for the rails. |
| public final Flux | Returns: the new Flux instancethe comparator to use comparator)Sorts the 'rails' of this |
| public final Flux | Returns: the new Flux instancethe comparator to use comparator, int the expected number of total elements capacityHint)Sorts the 'rails' of this |
| pack-priv static final <T> List | |
| public abstract void | subscribe(CoreSubscriber<? super T>[]
the subscribers array to run in parallel, the number of items
must be equal to the parallelism level of this ParallelFlux subscribers)Subscribes an array of Subscribers to this |
| public final Disposable | |
| public final Disposable | subscribe(Consumer<? super T>
consumer of onNext signals onNext)Subscribes to this |
| public final Disposable | subscribe(Consumer<? super T>
consumer of onNext signals onNext, Consumer<? super Throwable> consumer of error signal onError)Subscribes to this |
| public final Disposable | subscribe(Consumer<? super T>
consumer of onNext signals onNext, Consumer<? super Throwable> consumer of error signal onError, Runnable callback on completion signal onComplete)Subscribes to this |
| public final void | subscribe(CoreSubscriber<? super T>
the s)Subscriber interested into the published sequenceImplements reactor. Publisher#subscribe(Subscriber) that will bypass
Hooks#onLastOperator(Function) pointcut.
|
| public final Disposable | subscribe(Consumer<? super T>
consumer of onNext signals onNext, Consumer<? super Throwable> consumer of error signal onError, Runnable callback on completion signal onComplete, Consumer<? super Subscription> consumer of the subscription signal onSubscribe)Subscribes to this |
| public final Disposable | subscribe(Consumer<? super T>
consumer of onNext signals onNext, Consumer<? super Throwable> consumer of error signal onError, Runnable callback on completion signal onComplete, Context Context for the railsSubscribes to this |
| pack-priv final Disposable | |
| public final void | subscribe(Subscriber<? super T>
the subscriber to use on s)sequential() FluxImplements org. sequential() Flux and
subscribe to said Flux.
|
| public final ParallelFlux | |
| public final Mono | Returns: the new Mono instance emitting the reduced value or empty if theParallelFlux was emptyEmit an onComplete or onError signal once all values across 'rails' have been observed. |
| public String | |
| public final < the output value type U> ParallelFlux | Returns: theParallelFlux returned by the functionthe composer function from composer)ParallelFlux (this) to another
ParallelFluxAllows composing operators, in assembly time, on top of this |
| public final < the type of the resulting parallelized flux U> ParallelFlux | Returns: aParallelFlux of the composed groupsthe composition function to apply on each composer)railAllows composing operators off the groups (or 'rails'), as individual |
| protected final boolean | Returns: true if the number of subscribers equals to the parallelism levelthe array of Subscribers subscribers)Validates the number of subscribers and returns true if their number matches the parallelism level of this ParallelFlux. |