Top Description Fields Constructors Methods
reactor.core.publisher

public abstract Class Flux<T>

extends Object
implements CorePublisher<T>
Class Inheritance
All Implemented Interfaces
reactor.core.CorePublisher, org.reactivestreams.Publisher
Known Direct Subclasses
reactor.core.publisher.FluxArray, reactor.core.publisher.FluxAutoConnect, reactor.core.publisher.FluxAutoConnectFuseable, reactor.core.publisher.FluxCallable, reactor.core.publisher.FluxCombineLatest, reactor.core.publisher.FluxConcatArray, reactor.core.publisher.FluxConcatIterable, reactor.core.publisher.FluxGenerate, reactor.core.publisher.FluxInterval, reactor.core.publisher.FluxIterable, reactor.core.publisher.FluxJust, reactor.core.publisher.FluxMerge, reactor.core.publisher.FluxMergeComparing, reactor.core.publisher.FluxRefCount, reactor.core.publisher.FluxRefCountGrace, reactor.core.publisher.FluxRepeatWhen.RepeatWhenOtherSubscriber, reactor.core.publisher.FluxRetryWhen.RetryWhenOtherSubscriber, reactor.core.publisher.FluxSource, reactor.core.publisher.FluxSourceFuseable, reactor.core.publisher.FluxStream, reactor.core.publisher.SinkManyEmitterProcessor, reactor.core.publisher.SinkManyReplayProcessor, reactor.core.publisher.SinkManyUnicast, reactor.core.publisher.SinkManyUnicastNoBackpressure, reactor.core.publisher.FluxUsing, reactor.core.publisher.FluxUsingWhen, reactor.core.publisher.FluxWindowPredicate.WindowFlux, reactor.core.publisher.FluxWindowTimeout.InnerWindow, reactor.core.publisher.FluxZip, reactor.core.publisher.GroupedFlux, reactor.adapter.JdkFlowAdapter.FlowPublisherAsFlux, reactor.core.publisher.ConnectableFlux, reactor.core.publisher.ParallelGroup, reactor.core.publisher.FluxNever, reactor.core.publisher.FluxOperator, reactor.core.publisher.FluxProcessor, reactor.core.publisher.FluxPublishMulticast.FluxPublishMulticaster, reactor.core.publisher.FluxFromMonoOperator, reactor.core.publisher.FluxRange, reactor.core.publisher.FluxSubscribeOnCallable, reactor.core.publisher.ParallelMergeOrdered, reactor.core.publisher.SinkManyBestEffort, reactor.core.publisher.FluxCreate, reactor.core.publisher.FluxDefer, reactor.core.publisher.FluxDeferContextual, reactor.core.publisher.FluxEmpty, reactor.core.publisher.FluxError, reactor.core.publisher.FluxErrorOnRequest, reactor.core.publisher.FluxErrorSupplied, reactor.core.publisher.FluxFirstWithSignal, reactor.core.publisher.FluxFirstWithValue, reactor.core.publisher.FluxSubscribeOnValue, reactor.core.publisher.FluxSwitchOnFirst.AbstractSwitchOnFirstMain, reactor.core.publisher.ParallelMergeSequential, reactor.core.publisher.ParallelMergeSort
Type Parameters
<T>
the element type of this Reactive Streams Publisher
Imports
java.io.File, java.lang.reflect.ParameterizedType, java.time.Duration, java.util.ArrayList, .Collection, .Comparator, .HashMap, .HashSet, .Iterator, .List, .Map, .NoSuchElementException, .Objects, .Queue, .Set, .Spliterator, java.util.concurrent.Callable, .TimeUnit, .TimeoutException, java.util.function.BiConsumer, .BiFunction, .BiPredicate, .BooleanSupplier, .Consumer, .Function, .LongConsumer, .Predicate, .Supplier, java.util.logging.Level, java.util.stream.Collector, .Collectors, .IntStream, .Stream, io.micrometer.core.instrument.MeterRegistry, org.reactivestreams.Publisher, .Subscriber, .Subscription, reactor.core.CorePublisher, .CoreSubscriber, .Disposable, .Exceptions, .Fuseable, .Scannable, reactor.core.publisher.FluxOnAssembly.AssemblySnapshot, .FluxOnAssembly.CheckpointHeavySnapshot, .FluxOnAssembly.CheckpointLightSnapshot, .FluxSink.OverflowStrategy, reactor.core.scheduler.Scheduler, .Scheduler.Worker, .Schedulers, reactor.util.Logger, .Metrics, reactor.util.annotation.Nullable, reactor.util.concurrent.Queues, reactor.util.context.Context, .ContextView, reactor.util.function.Tuple2, .Tuple3, .Tuple4, .Tuple5, .Tuple6, .Tuple7, .Tuple8, .Tuples, reactor.core.observability.SignalListener, .SignalListenerFactory, reactor.util.retry.Retry

A Reactive Streams Publisher with rx operators that emits 0 to N elements, and then completes (successfully or with an error).

The recommended way to learn about the Flux API and discover new operators is through the reference documentation, rather than through this javadoc (as opposed to learning more about individual operators). See the "which operator do I need?" appendix.

It is intended to be used in implementations and return types. Input parameters should keep using raw Publisher as much as possible.

If it is known that the underlying Publisher will emit 0 or 1 element, Mono should be used instead.

Note that using state in the java.util.function / lambdas used within Flux operators should be avoided, as these may be shared between several Subscribers.

subscribe(CoreSubscriber) is an internal extension to subscribe(Subscriber) used internally for Context passing. User provided Subscriber may be passed to this "subscribe" extension but will loose the available per-subscribe Hooks#onLastOperator.

Authors
Sebastien Deleuze, Stephane Maldini, David Karnok, Simon Baslé
See Also
Mono

Field Summary

Modifier and TypeField and Description
pack-priv static final BooleanSupplier
pack-priv static final Function<T, R>
pack-priv static final Supplier<T>
pack-priv static final BiPredicate<T, U>
pack-priv static final Supplier<T>
pack-priv static final BiFunction<T, U, R>

Constructor Summary

AccessConstructor and Description
public
Flux()

Method Summary

Modifier and TypeMethod and Description
public final Mono<Boolean>

Returns:

a new Mono with true if all values satisfies a predicate and false otherwise
all
(Predicate<? super T>
the Predicate that needs to apply to all emitted items
predicate
)

Emit a single boolean true if all values of this sequence match the Predicate.

public final Mono<Boolean>

Returns:

a new Mono with true if any value satisfies a predicate and false otherwise
any
(Predicate<? super T>
the Predicate that needs to apply to at least one emitted item
predicate
)

Emit a single boolean true if any of the values of this Flux sequence match the predicate.

public final <
the returned instance type
P
>
P

Returns:

the Flux transformed to an instance of P
as
(Function<? super Flux<T>, P>
the Function to immediately map this Flux into a target type instance.
transformer
)

Transform this Flux into a target type.

public final T

Returns:

the first value or null
blockFirst
()

Subscribe to this Flux and block indefinitely until the upstream signals its first value or completes.

public final T

Returns:

the first value or null
blockFirst
(Duration
maximum time period to wait for before raising a RuntimeException
timeout
)

Subscribe to this Flux and block until the upstream signals its first value, completes or a timeout expires.

public final T

Returns:

the last value or null
blockLast
()

Subscribe to this Flux and block indefinitely until the upstream signals its last value or completes.

public final T

Returns:

the last value or null
blockLast
(Duration
maximum time period to wait for before raising a RuntimeException
timeout
)

Subscribe to this Flux and block until the upstream signals its last value, completes or a timeout expires.

public final Flux<List<T>>

Returns:

a buffered Flux of at most one List
buffer
()

Collect all incoming values into a single List buffer that will be emitted by the returned Flux once this Flux completes.

public final Flux<List<T>>

Returns:

a microbatched Flux of List
buffer
(int
the maximum collected size
maxSize
)

Collect incoming values into multiple List buffers that will be emitted by the returned Flux each time the given max size is reached or once this Flux completes.

public final <
the Collection buffer type
C extends Collection<? super T>
>
Flux<C>

Returns:

a microbatched Flux of Collection
buffer
(int
the maximum collected size
maxSize
,
Supplier<C>
a Supplier of the concrete Collection to use for each buffer
bufferSupplier
)

Collect incoming values into multiple user-defined Collection buffers that will be emitted by the returned Flux each time the given max size is reached or once this Flux completes.

public final Flux<List<T>>

Returns:

a microbatched Flux of possibly overlapped or gapped List
buffer
(int
the max collected size
maxSize
,
int
the number of items to count before creating a new buffer
skip
)

Collect incoming values into multiple List buffers that will be emitted by the returned Flux each time the given max size is reached or once this Flux completes.

public final <
the Collection buffer type
C extends Collection<? super T>
>
Flux<C>

Returns:

a microbatched Flux of possibly overlapped or gapped Collection
buffer
(int
the max collected size
maxSize
,
int
the number of items to count before creating a new buffer
skip
,
Supplier<C>
a Supplier of the concrete Collection to use for each buffer
bufferSupplier
)

Collect incoming values into multiple user-defined Collection buffers that will be emitted by the returned Flux each time the given max size is reached or once this Flux completes.

public final Flux<List<T>>

Returns:

a microbatched Flux of List delimited by signals from a Publisher
buffer
(Publisher<?>
the companion Publisher whose signals trigger new buffers
other
)

Collect incoming values into multiple List buffers, as delimited by the signals of a companion Publisher this operator will subscribe to.

public final <
the Collection buffer type
C extends Collection<? super T>
>
Flux<C>

Returns:

a microbatched Flux of Collection delimited by signals from a Publisher
buffer
(Publisher<?>
the companion Publisher whose signals trigger new buffers
other
,
Supplier<C>
a Supplier of the concrete Collection to use for each buffer
bufferSupplier
)

Collect incoming values into multiple user-defined Collection buffers, as delimited by the signals of a companion Publisher this operator will subscribe to.

public final Flux<List<T>>

Returns:

a microbatched Flux of List delimited by the given time span
buffer
(Duration
the duration from buffer creation until a buffer is closed and emitted
bufferingTimespan
)

Collect incoming values into multiple List buffers that will be emitted by the returned Flux every bufferingTimespan.

public final Flux<List<T>>

Returns:

a microbatched Flux of List delimited by the given period openBufferEvery and sized by bufferingTimespan
buffer
(Duration
the duration from buffer creation until a buffer is closed and emitted
bufferingTimespan
,
Duration
the interval at which to create a new buffer
openBufferEvery
)

Collect incoming values into multiple List buffers created at a given openBufferEvery period.

public final Flux<List<T>>

Returns:

a microbatched Flux of List delimited by the given period
buffer
(Duration
the duration from buffer creation until a buffer is closed and emitted
bufferingTimespan
,
Scheduler
a time-capable Scheduler instance to run on
timer
)

Collect incoming values into multiple List buffers that will be emitted by the returned Flux every bufferingTimespan, as measured on the provided Scheduler.

public final Flux<List<T>>

Returns:

a microbatched Flux of List delimited by the given period openBufferEvery and sized by bufferingTimespan
buffer
(Duration
the duration from buffer creation until a buffer is closed and emitted
bufferingTimespan
,
Duration
the interval at which to create a new buffer
openBufferEvery
,
Scheduler
a time-capable Scheduler instance to run on
timer
)

Collect incoming values into multiple List buffers created at a given openBufferEvery period, as measured on the provided Scheduler.

public final Flux<List<T>>

Returns:

a microbatched Flux of List delimited by given size or a given period timeout
bufferTimeout
(int
the max collected size
maxSize
,
Duration
the timeout enforcing the release of a partial buffer
maxTime
)

Collect incoming values into multiple List buffers that will be emitted by the returned Flux each time the buffer reaches a maximum size OR the maxTime Duration elapses.

public final <
the Collection buffer type
C extends Collection<? super T>
>
Flux<C>

Returns:

a microbatched Flux of Collection delimited by given size or a given period timeout
bufferTimeout
(int
the max collected size
maxSize
,
Duration
the timeout enforcing the release of a partial buffer
maxTime
,
Supplier<C>
a Supplier of the concrete Collection to use for each buffer
bufferSupplier
)

Collect incoming values into multiple user-defined Collection buffers that will be emitted by the returned Flux each time the buffer reaches a maximum size OR the maxTime Duration elapses.

public final Flux<List<T>>

Returns:

a microbatched Flux of List delimited by given size or a given period timeout
bufferTimeout
(int
the max collected size
maxSize
,
Duration
the timeout enforcing the release of a partial buffer
maxTime
,
Scheduler
a time-capable Scheduler instance to run on
timer
)

Collect incoming values into multiple List buffers that will be emitted by the returned Flux each time the buffer reaches a maximum size OR the maxTime Duration elapses, as measured on the provided Scheduler.

public final <
the Collection buffer type
C extends Collection<? super T>
>
Flux<C>

Returns:

a microbatched Flux of Collection delimited by given size or a given period timeout
bufferTimeout
(int
the max collected size
maxSize
,
Duration
the timeout enforcing the release of a partial buffer
maxTime
,
Scheduler
a time-capable Scheduler instance to run on
timer
,
Supplier<C>
a Supplier of the concrete Collection to use for each buffer
bufferSupplier
)

Collect incoming values into multiple user-defined Collection buffers that will be emitted by the returned Flux each time the buffer reaches a maximum size OR the maxTime Duration elapses, as measured on the provided Scheduler.

public final Flux<List<T>>

Returns:

a microbatched Flux of List delimited by given size or a given period timeout
bufferTimeout
(int
the max collected size
maxSize
,
Duration
the timeout enforcing the release of a partial buffer
maxTime
,
boolean
If true, prefetches maxSize * 4 from upstream and replenishes the buffer when the downstream demand is satisfactory. When false, no prefetching takes place and a single buffer is always ready to be pushed downstream.
fairBackpressure
)

Collect incoming values into multiple List buffers that will be emitted by the returned Flux each time the buffer reaches a maximum size OR the maxTime Duration elapses.

public final Flux<List<T>>

Returns:

a microbatched Flux of List delimited by given size or a given period timeout
bufferTimeout
(int
the max collected size
maxSize
,
Duration
the timeout enforcing the release of a partial buffer
maxTime
,
Scheduler
a time-capable Scheduler instance to run on
timer
,
boolean
If true, prefetches maxSize * 4 from upstream and replenishes the buffer when the downstream demand is satisfactory. When false, no prefetching takes place and a single buffer is always ready to be pushed downstream.
fairBackpressure
)

Collect incoming values into multiple List buffers that will be emitted by the returned Flux each time the buffer reaches a maximum size OR the maxTime Duration elapses, as measured on the provided Scheduler.

public final <
the Collection buffer type
C extends Collection<? super T>
>
Flux<C>

Returns:

a microbatched Flux of Collection delimited by given size or a given period timeout
bufferTimeout
(int
the max collected size
maxSize
,
Duration
the timeout enforcing the release of a partial buffer
maxTime
,
Supplier<C>
a Supplier of the concrete Collection to use for each buffer
bufferSupplier
,
boolean
If true, prefetches maxSize * 4 from upstream and replenishes the buffer when the downstream demand is satisfactory. When false, no prefetching takes place and a single buffer is always ready to be pushed downstream.
fairBackpressure
)

Collect incoming values into multiple user-defined Collection buffers that will be emitted by the returned Flux each time the buffer reaches a maximum size OR the maxTime Duration elapses.

public final <
the Collection buffer type
C extends Collection<? super T>
>
Flux<C>

Returns:

a microbatched Flux of Collection delimited by given size or a given period timeout
bufferTimeout
(int
the max collected size
maxSize
,
Duration
the timeout enforcing the release of a partial buffer
maxTime
,
Scheduler
a time-capable Scheduler instance to run on
timer
,
Supplier<C>
a Supplier of the concrete Collection to use for each buffer
bufferSupplier
,
boolean
If true, prefetches maxSize * 4 from upstream and replenishes the buffer when the downstream demand is satisfactory. When false, no prefetching takes place and a single buffer is always ready to be pushed downstream.
fairBackpressure
)

Collect incoming values into multiple user-defined Collection buffers that will be emitted by the returned Flux each time the buffer reaches a maximum size OR the maxTime Duration elapses, as measured on the provided Scheduler.

public final Flux<List<T>>

Returns:

a microbatched Flux of List
bufferUntil
(Predicate<? super T>
a predicate that triggers the next buffer when it becomes true.
predicate
)

Collect incoming values into multiple List buffers that will be emitted by the resulting Flux each time the given predicate returns true.

public final Flux<List<T>>

Returns:

a microbatched Flux of List
bufferUntil
(Predicate<? super T>
a predicate that triggers the next buffer when it becomes true.
predicate
,
boolean
set to true to include the triggering element in the new buffer rather than the old.
cutBefore
)

Collect incoming values into multiple List buffers that will be emitted by the resulting Flux each time the given predicate returns true.

public final Flux<List<T>>

Returns:

a microbatched Flux of List
bufferUntilChanged
()

Collect subsequent repetitions of an element (that is, if they arrive right after one another) into multiple List buffers that will be emitted by the resulting Flux.

public final <V> Flux<List<T>>

Returns:

a microbatched Flux of List
bufferUntilChanged
(Function<? super T, ? extends V>
function to compute comparison key for each element
keySelector
)

Collect subsequent repetitions of an element (that is, if they arrive right after one another), as compared by a key extracted through the user provided Function, into multiple List buffers that will be emitted by the resulting Flux.

public final <V> Flux<List<T>>

Returns:

a microbatched Flux of List
bufferUntilChanged
(Function<? super T, ? extends V>
function to compute comparison key for each element
keySelector
,
BiPredicate<? super V, ? super V>
predicate used to compare keys
keyComparator
)

Collect subsequent repetitions of an element (that is, if they arrive right after one another), as compared by a key extracted through the user provided Function and compared using a supplied BiPredicate, into multiple List buffers that will be emitted by the resulting Flux.

public final <
the element type of the buffer-opening sequence
U
,
the element type of the buffer-closing sequence
V
>
Flux<List<T>>

Returns:

a microbatched Flux of List delimited by an opening Publisher and a relative closing Publisher
bufferWhen
(Publisher<U>
a companion Publisher to subscribe for buffer creation signals.
bucketOpening
,
Function<? super U, ? extends Publisher<V>>
a factory that, given a buffer opening signal, returns a companion Publisher to subscribe to for buffer closure and emission signals.
closeSelector
)

Collect incoming values into multiple List buffers started each time an opening companion Publisher emits.

public final <
the element type of the buffer-opening sequence
U
,
the element type of the buffer-closing sequence
V
,
the Collection buffer type
C extends Collection<? super T>
>
Flux<C>

Returns:

a microbatched Flux of Collection delimited by an opening Publisher and a relative closing Publisher
bufferWhen
(Publisher<U>
a companion Publisher to subscribe for buffer creation signals.
bucketOpening
,
Function<? super U, ? extends Publisher<V>>
a factory that, given a buffer opening signal, returns a companion Publisher to subscribe to for buffer closure and emission signals.
closeSelector
,
Supplier<C>
a Supplier of the concrete Collection to use for each buffer
bufferSupplier
)

Collect incoming values into multiple user-defined Collection buffers started each time an opening companion Publisher emits.

public final Flux<List<T>>

Returns:

a microbatched Flux of List
bufferWhile
(Predicate<? super T>
a predicate that triggers the next buffer when it becomes false.
predicate
)

Collect incoming values into multiple List buffers that will be emitted by the resulting Flux.

public final Flux<T>

Returns:

a replaying Flux
cache
()

Turn this Flux into a hot source and cache last emitted signals for further Subscriber.

public final Flux<T>

Returns:

a replaying Flux
cache
(int
number of elements retained in cache
history
)

Turn this Flux into a hot source and cache last emitted signals for further Subscriber.

public final Flux<T>

Returns:

a replaying Flux
cache
(Duration
Time-to-live for each cached item and post termination.
ttl
)

Turn this Flux into a hot source and cache last emitted signals for further Subscriber.

public final Flux<T>

Returns:

a replaying Flux
cache
(Duration
Time-to-live for each cached item and post termination.
ttl
,
Scheduler
the Scheduler on which to measure the duration.
timer
)

Turn this Flux into a hot source and cache last emitted signals for further Subscriber.

public final Flux<T>

Returns:

a replaying Flux
cache
(int
number of elements retained in cache
history
,
Duration
Time-to-live for each cached item and post termination.
ttl
)

Turn this Flux into a hot source and cache last emitted signals for further Subscriber.

public final Flux<T>

Returns:

a replaying Flux
cache
(int
number of elements retained in cache
history
,
Duration
Time-to-live for each cached item and post termination.
ttl
,
Scheduler
the Scheduler on which to measure the duration.
timer
)

Turn this Flux into a hot source and cache last emitted signals for further Subscriber.

public final Flux<T>

Returns:

a scheduled cancel Flux
cancelOn
(Scheduler
the Scheduler to signal cancel on
scheduler
)

Prepare this Flux so that subscribers will cancel from it on a specified Scheduler.

public final <
the Flux output type
E
>
Flux<E>

Returns:

a casted Flux
cast
(Class<E>
the target class to cast to
clazz
)

Cast the current Flux produced type into a target produced type.

public final Flux<T>

Returns:

the assembly tracing Flux.
checkpoint
()

Activate traceback (full assembly tracing) for this particular Flux, in case of an error upstream of the checkpoint.

public final Flux<T>

Returns:

the assembly marked Flux
checkpoint
(String
a unique enough description to include in the light assembly traceback.
description
)

Activate traceback (assembly marker) for this particular Flux by giving it a description that will be reflected in the assembly traceback in case of an error upstream of the checkpoint.

public final Flux<T>

Returns:

the assembly marked Flux.
checkpoint
(String
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 forceStackTrace option).

public final <
the container type
E
>
Mono<E>

Returns:

a Mono of the collected container on complete
collect
(Supplier<E>
the supplier of the container instance for each Subscriber
containerSupplier
,
BiConsumer<E, ? super T>
a consumer of both the container instance and the value being currently collected
collector
)

Collect all elements emitted by this Flux into a user-defined container, by applying a collector BiConsumer taking the container and each element.

public final <
the container type
R
,
The mutable accumulation type
A
>
Mono<R>

Returns:

a Mono of the collected container on complete
collect
(Collector<? super T, A, ? extends R> collector)

Collect all elements emitted by this Flux into a container, by applying a Java 8 Stream API Collector The collected result will be emitted when this sequence completes, emitting the empty container if the sequence was empty.

public final Mono<List<T>>

Returns:

a Mono of a List of all values from this Flux
collectList
()

Collect all elements emitted by this Flux into a List that is emitted by the resulting Mono when this sequence completes, emitting the empty List if the sequence was empty.

public final <
the type of the key extracted from each source element
K
>
Mono<Map<K, T>>

Returns:

a Mono of a Map of key-element pairs (only including latest element in case of key conflicts)
collectMap
(Function<? super T, ? extends K>
a Function to map elements to a key for the Map
keyExtractor
)

Collect all elements emitted by this Flux into a hashed Map that is emitted by the resulting Mono when this sequence completes, emitting the empty Map if the sequence was empty.

public final <
the type of the key extracted from each source element
K
,
the type of the value extracted from each source element
V
>
Mono<Map<K, V>>

Returns:

a Mono of a Map of key-element pairs (only including latest element's value in case of key conflicts)
collectMap
(Function<? super T, ? extends K>
a Function to map elements to a key for the Map
keyExtractor
,
Function<? super T, ? extends V>
a Function to map elements to a value for the Map
valueExtractor
)

Collect all elements emitted by this Flux into a hashed Map that is emitted by the resulting Mono when this sequence completes, emitting the empty Map if the sequence was empty.

public final <
the type of the key extracted from each source element
K
,
the type of the value extracted from each source element
V
>
Mono<Map<K, V>>

Returns:

a Mono of a Map of key-value pairs (only including latest element's value in case of key conflicts)
collectMap
(final Function<? super T, ? extends K>
a Function to map elements to a key for the Map
keyExtractor
,
final Function<? super T, ? extends V>
a Function to map elements to a value for the Map
valueExtractor
,
Supplier<Map<K, V>>
a Map factory called for each Subscriber
mapSupplier
)

Collect all elements emitted by this Flux into a user-defined Map that is emitted by the resulting Mono when this sequence completes, emitting the empty Map if the sequence was empty.

public final <
the type of the key extracted from each source element
K
>
Mono<Map<K, Collection<T>>>

Returns:

a Mono of a Map of key-List(elements) pairs
collectMultimap
(Function<? super T, ? extends K>
a Function to map elements to a key for the Map
keyExtractor
)

Collect all elements emitted by this Flux into a multimap that is emitted by the resulting Mono when this sequence completes, emitting the empty multimap if the sequence was empty.

public final <
the type of the key extracted from each source element
K
,
the type of the value extracted from each source element
V
>
Mono<Map<K, Collection<V>>>

Returns:

a Mono of a Map of key-List(values) pairs
collectMultimap
(Function<? super T, ? extends K>
a Function to map elements to a key for the Map
keyExtractor
,
Function<? super T, ? extends V>
a Function to map elements to a value for the Map
valueExtractor
)

Collect all elements emitted by this Flux into a multimap that is emitted by the resulting Mono when this sequence completes, emitting the empty multimap if the sequence was empty.

public final <
the type of the key extracted from each source element
K
,
the type of the value extracted from each source element
V
>
Mono<Map<K, Collection<V>>>

Returns:

a Mono of a Map of key-Collection(values) pairs
collectMultimap
(final Function<? super T, ? extends K>
a Function to map elements to a key for the Map
keyExtractor
,
final Function<? super T, ? extends V>
a Function to map elements to a value for the Map
valueExtractor
,
Supplier<Map<K, Collection<V>>>
a multimap (Map of Collection) factory called for each Subscriber
mapSupplier
)

Collect all elements emitted by this Flux into a user-defined multimap that is emitted by the resulting Mono when this sequence completes, emitting the empty multimap if the sequence was empty.

public final Mono<List<T>>

Returns:

a Mono of a sorted List of all values from this Flux, in natural order
collectSortedList
()

Collect all elements emitted by this Flux until this sequence completes, and then sort them in natural order into a List that is emitted by the resulting Mono.

public final Mono<List<T>>

Returns:

a Mono of a sorted List of all values from this Flux
collectSortedList
(Comparator<? super T>
a Comparator to sort the items of this sequences
comparator
)

Collect all elements emitted by this Flux until this sequence completes, and then sort them using a Comparator into a List that is emitted by the resulting Mono.

public static <
type of the value from sources
T
,
The produced output after transformation by the given combinator
V
>
Flux<V>

Returns:

a Flux based on the produced combinations
combineLatest
(Function<Object[], V>
The aggregate function that will receive the latest value from each upstream and return the value to signal downstream
combinator
,
Publisher<? extends T>...
The Publisher sources to combine values from
sources
)

Build a Flux whose data are generated by the combination of the most recently published value from each of the Publisher sources.

public static <
type of the value from sources
T
,
The produced output after transformation by the given combinator
V
>
Flux<V>

Returns:

a Flux based on the produced combinations
combineLatest
(Function<Object[], V>
The aggregate function that will receive the latest value from each upstream and return the value to signal downstream
combinator
,
int
The demand sent to each combined source Publisher
prefetch
,
Publisher<? extends T>...
The Publisher sources to combine values from
sources
)

Build a Flux whose data are generated by the combination of the most recently published value from each of the Publisher sources.

public static <
type of the value from source1
T1
,
type of the value from source2
T2
,
The produced output after transformation by the given combinator
V
>
Flux<V>

Returns:

a Flux based on the produced combinations
combineLatest
(Publisher<? extends T1>
The first Publisher source to combine values from
source1
,
Publisher<? extends T2>
The second Publisher source to combine values from
source2
,
BiFunction<? super T1, ? super T2, ? extends V>
The aggregate function that will receive the latest value from each upstream and return the value to signal downstream
combinator
)

Build a Flux whose data are generated by the combination of the most recently published value from each of two Publisher sources.

public static <
type of the value from source1
T1
,
type of the value from source2
T2
,
type of the value from source3
T3
,
The produced output after transformation by the given combinator
V
>
Flux<V>

Returns:

a Flux based on the produced combinations
combineLatest
(Publisher<? extends T1>
The first Publisher source to combine values from
source1
,
Publisher<? extends T2>
The second Publisher source to combine values from
source2
,
Publisher<? extends T3>
The third Publisher source to combine values from
source3
,
Function<Object[], V>
The aggregate function that will receive the latest value from each upstream and return the value to signal downstream
combinator
)

Build a Flux whose data are generated by the combination of the most recently published value from each of three Publisher sources.

public static <
type of the value from source1
T1
,
type of the value from source2
T2
,
type of the value from source3
T3
,
type of the value from source4
T4
,
The produced output after transformation by the given combinator
V
>
Flux<V>

Returns:

a Flux based on the produced combinations
combineLatest
(Publisher<? extends T1>
The first Publisher source to combine values from
source1
,
Publisher<? extends T2>
The second Publisher source to combine values from
source2
,
Publisher<? extends T3>
The third Publisher source to combine values from
source3
,
Publisher<? extends T4>
The fourth Publisher source to combine values from
source4
,
Function<Object[], V>
The aggregate function that will receive the latest value from each upstream and return the value to signal downstream
combinator
)

Build a Flux whose data are generated by the combination of the most recently published value from each of four Publisher sources.

public static <
type of the value from source1
T1
,
type of the value from source2
T2
,
type of the value from source3
T3
,
type of the value from source4
T4
,
type of the value from source5
T5
,
The produced output after transformation by the given combinator
V
>
Flux<V>

Returns:

a Flux based on the produced combinations
combineLatest
(Publisher<? extends T1>
The first Publisher source to combine values from
source1
,
Publisher<? extends T2>
The second Publisher source to combine values from
source2
,
Publisher<? extends T3>
The third Publisher source to combine values from
source3
,
Publisher<? extends T4>
The fourth Publisher source to combine values from
source4
,
Publisher<? extends T5>
The fifth Publisher source to combine values from
source5
,
Function<Object[], V>
The aggregate function that will receive the latest value from each upstream and return the value to signal downstream
combinator
)

Build a Flux whose data are generated by the combination of the most recently published value from each of five Publisher sources.

public static <
type of the value from source1
T1
,
type of the value from source2
T2
,
type of the value from source3
T3
,
type of the value from source4
T4
,
type of the value from source5
T5
,
type of the value from source6
T6
,
The produced output after transformation by the given combinator
V
>
Flux<V>

Returns:

a Flux based on the produced combinations
combineLatest
(Publisher<? extends T1>
The first Publisher source to combine values from
source1
,
Publisher<? extends T2>
The second Publisher source to combine values from
source2
,
Publisher<? extends T3>
The third Publisher source to combine values from
source3
,
Publisher<? extends T4>
The fourth Publisher source to combine values from
source4
,
Publisher<? extends T5>
The fifth Publisher source to combine values from
source5
,
Publisher<? extends T6>
The sixth Publisher source to combine values from
source6
,
Function<Object[], V>
The aggregate function that will receive the latest value from each upstream and return the value to signal downstream
combinator
)

Build a Flux whose data are generated by the combination of the most recently published value from each of six Publisher sources.

public static <
The common base type of the values from sources
T
,
The produced output after transformation by the given combinator
V
>
Flux<V>

Returns:

a Flux based on the produced combinations
combineLatest
(Iterable<? extends Publisher<? extends T>>
The list of Publisher sources to combine values from
sources
,
Function<Object[], V>
The aggregate function that will receive the latest value from each upstream and return the value to signal downstream
combinator
)

Build a Flux whose data are generated by the combination of the most recently published value from each of the Publisher sources provided in an Iterable.

public static <
The common base type of the values from sources
T
,
The produced output after transformation by the given combinator
V
>
Flux<V>

Returns:

a Flux based on the produced combinations
combineLatest
(Iterable<? extends Publisher<? extends T>>
The list of Publisher sources to combine values from
sources
,
int
demand produced to each combined source Publisher
prefetch
,
Function<Object[], V>
The aggregate function that will receive the latest value from each upstream and return the value to signal downstream
combinator
)

Build a Flux whose data are generated by the combination of the most recently published value from each of the Publisher sources provided in an Iterable.

public static <
The type of values in both source and output sequences
T
>
Flux<T>

Returns:

a new Flux concatenating all source sequences
concat
(Iterable<? extends Publisher<? extends T>>
The Iterable of Publisher to concatenate
sources
)

Concatenate all sources provided in an Iterable, forwarding elements emitted by the sources downstream.

public static <
The type of values in both source and output sequences
T
>
Flux<T>

Returns:

a new Flux concatenating all inner sources sequences
concat
(Publisher<? extends Publisher<? extends T>>
The Publisher of Publisher to concatenate
sources
)

Concatenate all sources emitted as an onNext signal from a parent Publisher, forwarding elements emitted by the sources downstream.

public static <
The type of values in both source and output sequences
T
>
Flux<T>

Returns:

a new Flux concatenating all inner sources sequences
concat
(Publisher<? extends Publisher<? extends T>>
The Publisher of Publisher to concatenate
sources
,
int
the number of Publishers to prefetch from the outer Publisher
prefetch
)

Concatenate all sources emitted as an onNext signal from a parent Publisher, forwarding elements emitted by the sources downstream.

public static <
The type of values in both source and output sequences
T
>
Flux<T>

Returns:

a new Flux concatenating all source sequences
concat
(Publisher<? extends T>...
The Publisher of Publisher to concat
sources
)

Concatenate all sources provided as a vararg, forwarding elements emitted by the sources downstream.

public static <
The type of values in both source and output sequences
T
>
Flux<T>

Returns:

a new Flux concatenating all inner sources sequences, delaying errors
concatDelayError
(Publisher<? extends Publisher<? extends T>>
The Publisher of Publisher to concatenate
sources
)

Concatenate all sources emitted as an onNext signal from a parent Publisher, forwarding elements emitted by the sources downstream.

public static <
The type of values in both source and output sequences
T
>
Flux<T>

Returns:

a new Flux concatenating all inner sources sequences until complete or error
concatDelayError
(Publisher<? extends Publisher<? extends T>>
The Publisher of Publisher to concatenate
sources
,
int
number of elements to prefetch from the source, to be turned into inner Publishers
prefetch
)

Concatenate all sources emitted as an onNext signal from a parent Publisher, forwarding elements emitted by the sources downstream.

public static <
The type of values in both source and output sequences
T
>
Flux<T>

Returns:

a new Flux concatenating all inner sources sequences until complete or error
concatDelayError
(Publisher<? extends Publisher<? extends T>>
The Publisher of Publisher to concatenate
sources
,
boolean
delay error until all sources have been consumed instead of after the current source
delayUntilEnd
,
int
the number of Publishers to prefetch from the outer Publisher
prefetch
)

Concatenate all sources emitted as an onNext signal from a parent Publisher, forwarding elements emitted by the sources downstream.

public static <
The type of values in both source and output sequences
T
>
Flux<T>

Returns:

a new Flux concatenating all source sequences
concatDelayError
(Publisher<? extends T>...
The Publisher of Publisher to concat
sources
)

Concatenate all sources provided as a vararg, forwarding elements emitted by the sources downstream.

public final <
the produced concatenated type
V
>
Flux<V>

Returns:

a concatenated Flux
concatMap
(Function<? super T, ? extends Publisher<? extends V>>
the function to transform this sequence of T into concatenated sequences of V
mapper
)

Transform the elements emitted by this Flux asynchronously into Publishers, then flatten these inner publishers into a single Flux, sequentially and preserving order using concatenation.

public final <
the produced concatenated type
V
>
Flux<V>

Returns:

a concatenated Flux
concatMap
(Function<? super T, ? extends Publisher<? extends V>>
the function to transform this sequence of T into concatenated sequences of V
mapper
,
int
the number of values to prefetch from upstream source, or 0 to disable prefetching
prefetch
)

Transform the elements emitted by this Flux asynchronously into Publishers, then flatten these inner publishers into a single Flux, sequentially and preserving order using concatenation.

public final <
the produced concatenated type
V
>
Flux<V>

Returns:

a concatenated Flux
concatMapDelayError
(Function<? super T, ? extends Publisher<? extends V>>
the function to transform this sequence of T into concatenated sequences of V
mapper
)

Transform the elements emitted by this Flux asynchronously into Publishers, then flatten these inner publishers into a single Flux, sequentially and preserving order using concatenation.

public final <
the produced concatenated type
V
>
Flux<V>

Returns:

a concatenated Flux
concatMapDelayError
(Function<? super T, ? extends Publisher<? extends V>>
the function to transform this sequence of T into concatenated sequences of V
mapper
,
int
the number of values to prefetch from upstream source, or 0 to disable prefetching
prefetch
)

Transform the elements emitted by this Flux asynchronously into Publishers, then flatten these inner publishers into a single Flux, sequentially and preserving order using concatenation.

public final <
the produced concatenated type
V
>
Flux<V>

Returns:

a concatenated Flux
concatMapDelayError
(Function<? super T, ? extends Publisher<? extends V>>
the function to transform this sequence of T into concatenated sequences of V
mapper
,
boolean
delay error until all sources have been consumed instead of after the current source
delayUntilEnd
,
int
the number of values to prefetch from upstream source, or 0 to disable prefetching
prefetch
)

Transform the elements emitted by this Flux asynchronously into Publishers, then flatten these inner publishers into a single Flux, sequentially and preserving order using concatenation.

public final <
the merged output sequence type
R
>
Flux<R>

Returns:

a concatenation of the values from the Iterables obtained from each element in this Flux
concatMapIterable
(Function<? super T, ? extends Iterable<? extends R>>
the Function to transform input sequence into N Iterable
mapper
)

Transform the items emitted by this Flux into Iterable, then flatten the elements from those by concatenating them into a single Flux.

public final <
the merged output sequence type
R
>
Flux<R>

Returns:

a concatenation of the values from the Iterables obtained from each element in this Flux
concatMapIterable
(Function<? super T, ? extends Iterable<? extends R>>
the Function to transform input sequence into N Iterable
mapper
,
int
the number of values to request from the source upon subscription, to be transformed to Iterable
prefetch
)

Transform the items emitted by this Flux into Iterable, then flatten the emissions from those by concatenating them into a single Flux.

public final Flux<T>

Returns:

a concatenated Flux
concatWith
(Publisher<? extends T>
the Publisher sequence to concat after this Flux
other
)

Concatenate emissions of this Flux with the provided Publisher (no interleave).

public final Flux<T>

Returns:

a new Flux concatenating all source sequences
concatWithValues
(T...
The values to concatenate
values
)

Concatenates the values to the end of the Flux

<img class="marble" src="doc-files/marbles/concatWithValues.svg" alt="">

public final Flux<T>

Returns:

a new Flux where context-propagation API has been used to capture entries and inject them into the Context
contextCapture
()

If context-propagation library is on the classpath, this is a convenience shortcut to capture thread local values during the subscription phase and put them in the Context that is visible upstream of this operator.

public final Flux<T>

Returns:

a contextualized Flux
contextWrite
(ContextView
the ContextView to merge with the downstream Context, resulting in a new more complete Context that will be visible from upstream.
contextToAppend
)

Enrich the Context visible from downstream for the benefit of upstream operators, by making all values from the provided ContextView visible on top of pairs from downstream.

public final Flux<T>

Returns:

a contextualized Flux
contextWrite
(Function<Context, Context>
the Function to apply to the downstream Context, resulting in a new more complete Context that will be visible from upstream.
contextModifier
)

Enrich the Context visible from downstream for the benefit of upstream operators, by applying a Function to the downstream Context.

public final Mono<Long>

Returns:

a new Mono of Long count
count
()

Counts the number of values in this Flux.

pack-priv static BooleanSupplier
pack-priv static <O> Predicate<O>
countingPredicate(Predicate<O> predicate, long max)

public static <
The type of values in the sequence
T
>
Flux<T>

Returns:

a Flux
create
(Consumer<? super FluxSink<T>>
Consume the FluxSink provided per-subscriber by Reactor to generate signals.
emitter
)

Programmatically create a Flux with the capability of emitting multiple elements in a synchronous or asynchronous manner through the FluxSink API.

public static <
The type of values in the sequence
T
>
Flux<T>

Returns:

a Flux
create
(Consumer<? super FluxSink<T>>
Consume the FluxSink provided per-subscriber by Reactor to generate signals.
emitter
,
FluxSink.OverflowStrategy
the backpressure mode, see OverflowStrategy for the available backpressure modes
backpressure
)

Programmatically create a Flux with the capability of emitting multiple elements in a synchronous or asynchronous manner through the FluxSink API.

public final Flux<T>

Returns:

a new Flux
defaultIfEmpty
(T
the alternate value if this sequence is empty
defaultV
)

Provide a default unique value if this sequence is completed without any data

<img class="marble" src="doc-files/marbles/defaultIfEmpty.svg" alt="">

public static <
the type of values passing through the Flux
T
>
Flux<T>

Returns:

a deferred Flux
defer
(Supplier<? extends Publisher<T>>
the Publisher Supplier to call on subscribe
supplier
)

Lazily supply a Publisher every time a Subscription is made on the resulting Flux, so the actual source instantiation is deferred until each subscribe and the Supplier can create a subscriber-specific instance.

public static <
the type of values passing through the Flux
T
>
Flux<T>

Returns:

a deferred Flux deriving actual Flux from context values for each subscription
deferContextual
(Function<ContextView, ? extends Publisher<T>>
the Publisher Function to call on subscribe
contextualPublisherFactory
)

Lazily supply a Publisher every time a Subscription is made on the resulting Flux, so the actual source instantiation is deferred until each subscribe and the Function can create a subscriber-specific instance.

public final Flux<T>

Returns:

a delayed Flux
delayElements
(Duration
duration by which to delay each Subscriber#onNext signal
delay
)

Delay each of this Flux elements (Subscriber#onNext signals) by a given Duration.

public final Flux<T>

Returns:

a delayed Flux
delayElements
(Duration
period to delay each Subscriber#onNext signal
delay
,
Scheduler
a time-capable Scheduler instance to delay each signal on
timer
)

Delay each of this Flux elements (Subscriber#onNext signals) by a given Duration.

public final Flux<T>

Returns:

a shifted Flux emitting at the same frequency as the source
delaySequence
(Duration
Duration to shift the sequence by
delay
)

Shift this Flux forward in time by a given Duration.

public final Flux<T>

Returns:

a shifted Flux emitting at the same frequency as the source
delaySequence
(Duration
Duration to shift the sequence by
delay
,
Scheduler
a time-capable Scheduler instance to delay signals on
timer
)

Shift this Flux forward in time by a given Duration.

public final Flux<T>

Returns:

a delayed Flux
delaySubscription
(Duration
duration before subscribing this Flux
delay
)

Delay the subscription to this Flux source until the given period elapses.

public final Flux<T>

Returns:

a delayed Flux
delaySubscription
(Duration
Duration before subscribing this Flux
delay
,
Scheduler
a time-capable Scheduler instance to run on
timer
)

Delay the subscription to this Flux source until the given period elapses, as measured on the user-provided Scheduler.

public final <
the other source type
U
>
Flux<T>

Returns:

a delayed Flux
delaySubscription
(Publisher<U>
a companion Publisher whose onNext/onComplete signal will trigger the subscription
subscriptionDelay
)

Delay the subscription to this Flux source until another Publisher signals a value or completes.

public final Flux<T>

Returns:

this Flux, but with elements delayed until their derived publisher terminates.
delayUntil
(Function<? super T, ? extends Publisher<?>>
a Function that maps each element into a Publisher whose termination will trigger relaying the value.
triggerProvider
)

Subscribe to this Flux and generate a Publisher from each of this Flux elements, each acting as a trigger for relaying said element.

public final <
the dematerialized type
X
>
Flux<X>

Returns:

a dematerialized Flux
dematerialize
()

An operator working only if this Flux emits onNext, onError or onComplete Signal instances, transforming these materialized signals into real signals on the Subscriber.

public final Flux<T>

Returns:

a filtering Flux only emitting distinct values
distinct
()

For each Subscriber, track elements from this Flux that have been seen and filter out duplicates.

public final <
the type of the key extracted from each value in this sequence
V
>
Flux<T>

Returns:

a filtering Flux only emitting values with distinct keys
distinct
(Function<? super T, ? extends V>
function to compute comparison key for each element
keySelector
)

For each Subscriber, track elements from this Flux that have been seen and filter out duplicates, as compared by a key extracted through the user provided Function.

public final <
the type of the key extracted from each value in this sequence
V
,
the type of Collection used for distinct checking of keys
C extends Collection<? super V>
>
Flux<T>

Returns:

a filtering Flux only emitting values with distinct keys
distinct
(Function<? super T, ? extends V>
function to compute comparison key for each element
keySelector
,
Supplier<C>
supplier of the Collection used for distinct check through add of the key.
distinctCollectionSupplier
)

For each Subscriber, track elements from this Flux that have been seen and filter out duplicates, as compared by a key extracted through the user provided Function and by the add method of the Collection supplied (typically a Set).

public final <
the type of the key extracted from each value in this sequence
V
,
the type of store backing the BiPredicate
C
>
Flux<T>

Returns:

a filtering Flux only emitting values with distinct keys
distinct
(Function<? super T, ? extends V>
function to compute comparison key for each element
keySelector
,
Supplier<C>
supplier of the arbitrary store object used in distinct checks along the extracted key.
distinctStoreSupplier
,
BiPredicate<C, V>
the BiPredicate to apply to the arbitrary store + extracted key to perform a distinct check. Since nothing is assumed of the store, this predicate should also add the key to the store as necessary.
distinctPredicate
,
Consumer<C>
the cleanup callback to invoke on the store upon termination.
cleanup
)

For each Subscriber, track elements from this Flux that have been seen and filter out duplicates, as compared by applying a BiPredicate on an arbitrary user-supplied <C> store and a key extracted through the user provided Function.

public final Flux<T>

Returns:

a filtering Flux with only one occurrence in a row of each element (yet elements can repeat in the overall sequence)
distinctUntilChanged
()

Filter out subsequent repetitions of an element (that is, if they arrive right after one another).

public final <
the type of the key extracted from each value in this sequence
V
>
Flux<T>

Returns:

a filtering Flux with only one occurrence in a row of each element of the same key (yet element keys can repeat in the overall sequence)
distinctUntilChanged
(Function<? super T, ? extends V>
function to compute comparison key for each element
keySelector
)

Filter out subsequent repetitions of an element (that is, if they arrive right after one another), as compared by a key extracted through the user provided Function using equality.

public final <
the type of the key extracted from each value in this sequence
V
>
Flux<T>

Returns:

a filtering Flux with only one occurrence in a row of each element of the same key for which the predicate returns true (yet element keys can repeat in the overall sequence)
distinctUntilChanged
(Function<? super T, ? extends V>
function to compute comparison key for each element
keySelector
,
BiPredicate<? super V, ? super V>
predicate used to compare keys.
keyComparator
)

Filter out subsequent repetitions of an element (that is, if they arrive right after one another), as compared by a key extracted through the user provided Function and then comparing keys with the supplied BiPredicate.

public final Flux<T>

Returns:

an observed Flux
doAfterTerminate
(Runnable
the callback to call after Subscriber#onComplete or Subscriber#onError
afterTerminate
)

Add behavior (side-effect) triggered after the Flux terminates, either by completing downstream successfully or with an error.

public final Flux<T>

Returns:

an observed Flux
doFinally
(Consumer<SignalType>
the callback to execute after a terminal signal (complete, error or cancel)
onFinally
)

Add behavior (side-effect) triggered after the Flux terminates for any reason, including cancellation.

public final Flux<T>

Returns:

an observed Flux
doFirst
(Runnable
the callback to execute before the Flux is subscribed to
onFirst
)

Add behavior (side-effect) triggered before the Flux is subscribed to, which should be the first event after assembly time.

public final Flux<T>

Returns:

an observed Flux
doOnCancel
(Runnable
the callback to call on Subscription#cancel
onCancel
)

Add behavior (side-effect) triggered when the Flux is cancelled.

public final Flux<T>

Returns:

an observed Flux
doOnComplete
(Runnable
the callback to call on Subscriber#onComplete
onComplete
)

Add behavior (side-effect) triggered when the Flux completes successfully.

public final <R> Flux<T>

Returns:

a Flux that cleans up matching elements that get discarded upstream of it.
doOnDiscard
(final Class<R>
the Class of elements in the upstream chain of operators that this cleanup hook should take into account.
type
,
final Consumer<? super R>
a Consumer of elements in the upstream chain of operators that performs the cleanup.
discardHook
)

Potentially modify the behavior of the whole chain of operators upstream of this one to conditionally clean up elements that get discarded by these operators.

public final Flux<T>

Returns:

an observed Flux
doOnEach
(Consumer<? super Signal<T>> signalConsumer)

Add behavior (side-effects) triggered when the Flux emits an item, fails with an error or completes successfully.

public final Flux<T>

Returns:

an observed Flux
doOnError
(Consumer<? super Throwable>
the callback to call on Subscriber#onError
onError
)

Add behavior (side-effect) triggered when the Flux completes with an error.

public final <
type of the error to handle
E extends Throwable
>
Flux<T>

Returns:

an observed Flux
doOnError
(Class<E>
the type of exceptions to handle
exceptionType
,
final Consumer<? super E>
the error handler for each error
onError
)

Add behavior (side-effect) triggered when the Flux completes with an error matching the given exception type.

public final Flux<T>

Returns:

an observed Flux
doOnError
(Predicate<? super Throwable>
the matcher for exceptions to handle
predicate
,
final Consumer<? super Throwable>
the error handler for each error
onError
)

Add behavior (side-effect) triggered when the Flux completes with an error matching the given exception.

public final Flux<T>

Returns:

an observed Flux
doOnNext
(Consumer<? super T>
the callback to call on Subscriber#onNext
onNext
)

Add behavior (side-effect) triggered when the Flux emits an item.

public final Flux<T>

Returns:

an observed Flux
doOnRequest
(LongConsumer
the consumer to invoke on each request
consumer
)

Add behavior (side-effect) triggering a LongConsumer when this Flux receives any request.

pack-priv static <T> Flux<T>
doOnSignal(Flux<T> source, Consumer<? super Subscription> onSubscribe, Consumer<? super T> onNext, Consumer<? super Throwable> onError, Runnable onComplete, Runnable onAfterTerminate, LongConsumer onRequest, Runnable onCancel)

public final Flux<T>

Returns:

an observed Flux
doOnSubscribe
(Consumer<? super Subscription>
the callback to call on Subscriber#onSubscribe
onSubscribe
)

Add behavior (side-effect) triggered when the Flux is being subscribed, that is to say when a Subscription has been produced by the Publisher and is being passed to the Subscriber#onSubscribe(Subscription).

public final Flux<T>

Returns:

an observed Flux
doOnTerminate
(Runnable
the callback to call on Subscriber#onComplete or Subscriber#onError
onTerminate
)

Add behavior (side-effect) triggered when the Flux terminates, either by completing successfully or failing with an error.

public final Flux<Tuple2<Long, T>>

Returns:

a new Flux that emits a tuple of time elapsed in milliseconds and matching data
elapsed
()

Map this Flux into Tuple2<Long, T> of timemillis and source data.

public final Flux<Tuple2<Long, T>>

Returns:

a new Flux that emits tuples of time elapsed in milliseconds and matching data
elapsed
(Scheduler scheduler)

Map this Flux into Tuple2<Long, T> of timemillis and source data.

public final Mono<T>

Returns:

a Mono of the item at the specified zero-based index
elementAt
(int
zero-based index of the only item to emit
index
)

Emit only the element at the given index position or IndexOutOfBoundsException if the sequence is shorter.

public final Mono<T>

Returns:

a Mono of the item at the specified zero-based index or a default value
elementAt
(int
zero-based index of the only item to emit
index
,
T
a default value to emit if the sequence is shorter
defaultValue
)

Emit only the element at the given index position or fall back to a default value if the sequence is shorter.

public static <
the reified type of the target Subscriber
T
>
Flux<T>

Returns:

an empty Flux
empty
()

Create a Flux that completes without emitting any item.

pack-priv static <U, V> BiPredicate<U, V>
public static <
the reified type of the target Subscriber
T
>
Flux<T>

Returns:

a new failing Flux
error
(Throwable
the error to signal to each Subscriber
error
)

Create a Flux that terminates with the specified error immediately after being subscribed to.

public static <
the reified type of the target Subscriber
T
>
Flux<T>

Returns:

a new failing Flux
error
(Supplier<? extends Throwable>
the error signal Supplier to invoke for each Subscriber
errorSupplier
)

Create a Flux that terminates with an error immediately after being subscribed to.

public static <
the reified type of the target Subscriber
O
>
Flux<O>

Returns:

a new failing Flux
error
(Throwable
the error to signal to each Subscriber
throwable
,
boolean
if true, will onError on the first request instead of subscribe().
whenRequested
)

Create a Flux that terminates with the specified error, either immediately after being subscribed to or after being first requested.

public final Flux<T>

Returns:

a breadth-first expanded Flux
expand
(Function<? super T, ? extends Publisher<? extends T>>
the Function applied at each level of recursion to expand values into a Publisher, producing a graph.
expander
,
int
a capacity hint to prepare the inner queues to accommodate n elements per level of recursion.
capacityHint
)

Recursively expand elements into a graph and emit all the resulting element using a breadth-first traversal strategy.

public final Flux<T>

Returns:

a breadth-first expanded Flux
expand
(Function<? super T, ? extends Publisher<? extends T>>
the Function applied at each level of recursion to expand values into a Publisher, producing a graph.
expander
)

Recursively expand elements into a graph and emit all the resulting element using a breadth-first traversal strategy.

public final Flux<T>

Returns:

a Flux expanded depth-first
expandDeep
(Function<? super T, ? extends Publisher<? extends T>>
the Function applied at each level of recursion to expand values into a Publisher, producing a graph.
expander
,
int
a capacity hint to prepare the inner queues to accommodate n elements per level of recursion.
capacityHint
)

Recursively expand elements into a graph and emit all the resulting element, in a depth-first traversal order.

public final Flux<T>

Returns:

a Flux expanded depth-first
expandDeep
(Function<? super T, ? extends Publisher<? extends T>>
the Function applied at each level of recursion to expand values into a Publisher, producing a graph.
expander
)

Recursively expand elements into a graph and emit all the resulting element, in a depth-first traversal order.

public final Flux<T>

Returns:

a new Flux containing only values that pass the predicate test
filter
(Predicate<? super T>
the Predicate to test values against
p
)

Evaluate each source value against the given Predicate.

public final Flux<T>

Returns:

a filtered Flux
filterWhen
(Function<? super T, ? extends Publisher<Boolean>>
the function generating a Publisher of Boolean for each value, to filter the Flux with
asyncPredicate
)

Test each value emitted by this Flux asynchronously using a generated Publisher<Boolean> test.

public final Flux<T>

Returns:

a filtered Flux
filterWhen
(Function<? super T, ? extends Publisher<Boolean>>
the function generating a Publisher of Boolean for each value, to filter the Flux with
asyncPredicate
,
int
the maximum expected number of values to hold pending a result of their respective asynchronous predicates, rounded to the next power of two. This is capped depending on the size of the heap and the JVM limits, so be careful with large values (although eg. 65536 should still be fine). Also serves as the initial request size for the source.
bufferSize
)

Test each value emitted by this Flux asynchronously using a generated Publisher<Boolean> test.

public static <
The type of values in both source and output sequences
I
>
Flux<I>

Returns:

a new Flux behaving like the fastest of its sources
first
(Publisher<? extends I>...
The competing source publishers
sources
)

Deprecated use firstWithSignal(Publisher[]). To be removed in reactor 3.5.
Pick the first Publisher to emit any signal (onNext/onError/onComplete) and replay all signals from that Publisher, effectively behaving like the fastest of these competing sources.
public static <
The type of values in both source and output sequences
I
>
Flux<I>

Returns:

a new Flux behaving like the fastest of its sources
first
(Iterable<? extends Publisher<? extends I>>
The competing source publishers
sources
)

Deprecated use firstWithSignal(Iterable). To be removed in reactor 3.5.
Pick the first Publisher to emit any signal (onNext/onError/onComplete) and replay all signals from that Publisher, effectively behaving like the fastest of these competing sources.
public static <
The type of values in both source and output sequences
I
>
Flux<I>

Returns:

a new Flux behaving like the fastest of its sources
firstWithSignal
(Publisher<? extends I>...
The competing source publishers
sources
)

Pick the first Publisher to emit any signal (onNext/onError/onComplete) and replay all signals from that Publisher, effectively behaving like the fastest of these competing sources.

public static <
The type of values in both source and output sequences
I
>
Flux<I>

Returns:

a new Flux behaving like the fastest of its sources
firstWithSignal
(Iterable<? extends Publisher<? extends I>>
The competing source publishers
sources
)

Pick the first Publisher to emit any signal (onNext/onError/onComplete) and replay all signals from that Publisher, effectively behaving like the fastest of these competing sources.

public static <
The type of values in both source and output sequences
I
>
Flux<I>

Returns:

a new Flux behaving like the fastest of its sources
firstWithValue
(Iterable<? extends Publisher<? extends I>>
An Iterable of the competing source publishers
sources
)

Pick the first Publisher to emit any value and replay all values from that Publisher, effectively behaving like the source that first emits an onNext.

public static <
The type of values in both source and output sequences
I
>
Flux<I>

Returns:

a new Flux behaving like the fastest of its sources
firstWithValue
(Publisher<? extends I>
The first competing source publisher
first
,
Publisher<? extends I>...
The other competing source publishers
others
)

Pick the first Publisher to emit any value and replay all values from that Publisher, effectively behaving like the source that first emits an onNext.

public final <
the merged output sequence type
R
>
Flux<R>

Returns:

a new Flux
flatMap
(Function<? super T, ? extends Publisher<? extends R>>
the Function to transform input sequence into N sequences Publisher
mapper
)

Transform the elements emitted by this Flux asynchronously into Publishers, then flatten these inner publishers into a single Flux through merging, which allow them to interleave.

public final <
the merged output sequence type
V
>
Flux<V>

Returns:

a new Flux
flatMap
(Function<? super T, ? extends Publisher<? extends V>>
the Function to transform input sequence into N sequences Publisher
mapper
,
int
the maximum number of in-flight inner sequences
concurrency
)

Transform the elements emitted by this Flux asynchronously into Publishers, then flatten these inner publishers into a single Flux through merging, which allow them to interleave.

public final <
the merged output sequence type
V
>
Flux<V>

Returns:

a merged Flux
flatMap
(Function<? super T, ? extends Publisher<? extends V>>
the Function to transform input sequence into N sequences Publisher
mapper
,
int
the maximum number of in-flight inner sequences
concurrency
,
int
the maximum in-flight elements from each inner Publisher sequence
prefetch
)

Transform the elements emitted by this Flux asynchronously into Publishers, then flatten these inner publishers into a single Flux through merging, which allow them to interleave.

public final <
the output Publisher type target
R
>
Flux<R>

Returns:

a new Flux
flatMap
(Function<? super T, ? extends Publisher<? extends R>>
the Function to call on next data and returning a sequence to merge. Use null to ignore (provided at least one other mapper is specified).
mapperOnNext
,
Function<? super Throwable, ? extends Publisher<? extends R>>
the Function to call on error signal and returning a sequence to merge. Use null to ignore (provided at least one other mapper is specified).
mapperOnError
,
Supplier<? extends Publisher<? extends R>>
the Function to call on complete signal and returning a sequence to merge. Use null to ignore (provided at least one other mapper is specified).
mapperOnComplete
)

Transform the signals emitted by this Flux asynchronously into Publishers, then flatten these inner publishers into a single Flux through merging, which allow them to interleave.

pack-priv final <V> Flux<V>
flatMap(Function<? super T, ? extends Publisher<? extends V>> mapper, boolean delayError, int concurrency, int prefetch)

public final <
the merged output sequence type
V
>
Flux<V>

Returns:

a merged Flux
flatMapDelayError
(Function<? super T, ? extends Publisher<? extends V>>
the Function to transform input sequence into N sequences Publisher
mapper
,
int
the maximum number of in-flight inner sequences
concurrency
,
int
the maximum in-flight elements from each inner Publisher sequence
prefetch
)

Transform the elements emitted by this Flux asynchronously into Publishers, then flatten these inner publishers into a single Flux through merging, which allow them to interleave.

public final <
the merged output sequence type
R
>
Flux<R>

Returns:

a concatenation of the values from the Iterables obtained from each element in this Flux
flatMapIterable
(Function<? super T, ? extends Iterable<? extends R>>
the Function to transform input sequence into N Iterable
mapper
)

Transform the items emitted by this Flux into Iterable, then flatten the elements from those by merging them into a single Flux.

public final <
the merged output sequence type
R
>
Flux<R>

Returns:

a concatenation of the values from the Iterables obtained from each element in this Flux
flatMapIterable
(Function<? super T, ? extends Iterable<? extends R>>
the Function to transform input sequence into N Iterable
mapper
,
int
the number of values to request from the source upon subscription, to be transformed to Iterable
prefetch
)

Transform the items emitted by this Flux into Iterable, then flatten the emissions from those by merging them into a single Flux.

public final <
the merged output sequence type
R
>
Flux<R>

Returns:

a merged Flux, subscribing early but keeping the original ordering
flatMapSequential
(Function<? super T, ? extends Publisher<? extends R>>
the Function to transform input sequence into N sequences Publisher
mapper
)

Transform the elements emitted by this Flux asynchronously into Publishers, then flatten these inner publishers into a single Flux, but merge them in the order of their source element.

public final <
the merged output sequence type
R
>
Flux<R>

Returns:

a merged Flux, subscribing early but keeping the original ordering
flatMapSequential
(Function<? super T, ? extends Publisher<? extends R>>
the Function to transform input sequence into N sequences Publisher
mapper
,
int
the maximum number of in-flight inner sequences
maxConcurrency
)

Transform the elements emitted by this Flux asynchronously into Publishers, then flatten these inner publishers into a single Flux, but merge them in the order of their source element.

public final <
the merged output sequence type
R
>
Flux<R>

Returns:

a merged Flux, subscribing early but keeping the original ordering
flatMapSequential
(Function<? super T, ? extends Publisher<? extends R>>
the Function to transform input sequence into N sequences Publisher
mapper
,
int
the maximum number of in-flight inner sequences
maxConcurrency
,
int
the maximum in-flight elements from each inner Publisher sequence
prefetch
)

Transform the elements emitted by this Flux asynchronously into Publishers, then flatten these inner publishers into a single Flux, but merge them in the order of their source element.

pack-priv final <R> Flux<R>
flatMapSequential(Function<? super T, ? extends Publisher<? extends R>> mapper, boolean delayError, int maxConcurrency, int prefetch)

public final <
the merged output sequence type
R
>
Flux<R>

Returns:

a merged Flux, subscribing early but keeping the original ordering
flatMapSequentialDelayError
(Function<? super T, ? extends Publisher<? extends R>>
the Function to transform input sequence into N sequences Publisher
mapper
,
int
the maximum number of in-flight inner sequences
maxConcurrency
,
int
the maximum in-flight elements from each inner Publisher sequence
prefetch
)

Transform the elements emitted by this Flux asynchronously into Publishers, then flatten these inner publishers into a single Flux, but merge them in the order of their source element.

public static <
The type of values in both source and output sequences
T
>
Flux<T>

Returns:

a new Flux
from
(Publisher<? extends T>
the source to decorate
source
)

Decorate the specified Publisher with the Flux API.

public static <
The type of values in the source array and resulting Flux
T
>
Flux<T>

Returns:

a new Flux
fromArray
(T[]
the array to read data from
array
)

Create a Flux that emits the items contained in the provided array.

public static <
The type of values in the source Iterable and resulting Flux
T
>
Flux<T>

Returns:

a new Flux
fromIterable
(Iterable<? extends T>
the Iterable to read data from
it
)

Create a Flux that emits the items contained in the provided Iterable.

public static <
The type of values in the source Stream and resulting Flux
T
>
Flux<T>

Returns:

a new Flux
fromStream
(Stream<? extends T>
the Stream to read data from
s
)

Create a Flux that emits the items contained in the provided Stream.

public static <
The type of values in the source Stream and resulting Flux
T
>
Flux<T>

Returns:

a new Flux
fromStream
(Supplier<Stream<? extends T>>
the Supplier that generates the Stream from which to read data
streamSupplier
)

Create a Flux that emits the items contained in a Stream created by the provided Supplier for each subscription.

public static <
the value type emitted
T
>
Flux<T>

Returns:

a Flux
generate
(Consumer<SynchronousSink<T>>
Consume the SynchronousSink provided per-subscriber by Reactor to generate a single signal on each pass.
generator
)

Programmatically create a Flux by generating signals one-by-one via a consumer callback.

public static <
the value type emitted
T
,
the per-subscriber custom state type
S
>
Flux<T>

Returns:

a Flux
generate
(Callable<S>
called for each incoming Subscriber to provide the initial state for the generator bifunction
stateSupplier
,
BiFunction<S, SynchronousSink<T>, S>
Consume the SynchronousSink provided per-subscriber by Reactor as well as the current state to generate a single signal on each pass and return a (new) state.
generator
)

Programmatically create a Flux by generating signals one-by-one via a consumer callback and some state.

public static <
the value type emitted
T
,
the per-subscriber custom state type
S
>
Flux<T>

Returns:

a Flux
generate
(Callable<S>
called for each incoming Subscriber to provide the initial state for the generator bifunction
stateSupplier
,
BiFunction<S, SynchronousSink<T>, S>
Consume the SynchronousSink provided per-subscriber by Reactor as well as the current state to generate a single signal on each pass and return a (new) state.
generator
,
Consumer<? super S>
called after the generator has terminated or the downstream cancelled, receiving the last state to be handled (i.e., release resources or do other cleanup).
stateConsumer
)

Programmatically create a Flux by generating signals one-by-one via a consumer callback and some state, with a final cleanup callback.

public int

Returns:

the prefetch configuration of the Flux, -1 if unspecified
getPrefetch
()

The prefetch configuration of the Flux

public final <
the key type extracted from each value of this sequence
K
>
Flux<GroupedFlux<K, T>>

Returns:

a Flux of GroupedFlux grouped sequences
groupBy
(Function<? super T, ? extends K>
the key mapping Function that evaluates an incoming data and returns a key.
keyMapper
)

Divide this sequence into dynamically created Flux (or groups) for each unique key, as produced by the provided keyMapper Function.

public final <
the key type extracted from each value of this sequence
K
>
Flux<GroupedFlux<K, T>>

Returns:

a Flux of GroupedFlux grouped sequences
groupBy
(Function<? super T, ? extends K>
the key mapping Function that evaluates an incoming data and returns a key.
keyMapper
,
int
the number of values to prefetch from the source
prefetch
)

Divide this sequence into dynamically created Flux (or groups) for each unique key, as produced by the provided keyMapper Function.

public final <
the key type extracted from each value of this sequence
K
,
the value type extracted from each value of this sequence
V
>
Flux<GroupedFlux<K, V>>

Returns:

a Flux of GroupedFlux grouped sequences
groupBy
(Function<? super T, ? extends K>
the key mapping function that evaluates an incoming data and returns a key.
keyMapper
,
Function<? super T, ? extends V>
the value mapping function that evaluates which data to extract for re-routing.
valueMapper
)

Divide this sequence into dynamically created Flux (or groups) for each unique key, as produced by the provided keyMapper Function.

public final <
the key type extracted from each value of this sequence
K
,
the value type extracted from each value of this sequence
V
>
Flux<GroupedFlux<K, V>>

Returns:

a Flux of GroupedFlux grouped sequences
groupBy
(Function<? super T, ? extends K>
the key mapping function that evaluates an incoming data and returns a key.
keyMapper
,
Function<? super T, ? extends V>
the value mapping function that evaluates which data to extract for re-routing.
valueMapper
,
int
the number of values to prefetch from the source
prefetch
)

Divide this sequence into dynamically created Flux (or groups) for each unique key, as produced by the provided keyMapper Function.

public final <
the type of the elements from the right Publisher
TRight
,
the type for this Flux window signals
TLeftEnd
,
the type for the right Publisher window signals
TRightEnd
,
the combined result type
R
>
Flux<R>

Returns:

a joining Flux
groupJoin
(Publisher<? extends TRight>
the other Publisher to correlate items with
other
,
Function<? super T, ? extends Publisher<TLeftEnd>>
a function that returns a Publisher whose emissions indicate the time window for the source value to be considered
leftEnd
,
Function<? super TRight, ? extends Publisher<TRightEnd>>
a function that returns a Publisher whose emissions indicate the time window for the right Publisher value to be considered
rightEnd
,
BiFunction<? super T, ? super Flux<TRight>, ? extends R>
a function that takes an item emitted by this Flux and a Flux representation of the overlapping item from the other Publisher and returns the value to be emitted by the resulting Flux
resultSelector
)

Map values from two Publishers into time windows and emit combination of values in case their windows overlap.

public final <
the transformed type
R
>
Flux<R>

Returns:

a transformed Flux
handle
(BiConsumer<? super T, SynchronousSink<R>>
the handling BiConsumer
handler
)

Handle the items emitted by this Flux by calling a biconsumer with the output sink for each onNext.

public final Mono<Boolean>

Returns:

a new Flux with true if any element is equal to a given value and false otherwise
hasElement
(T
constant compared to incoming signals
value
)

Emit a single boolean true if any of the elements of this Flux sequence is equal to the provided value.

public final Mono<Boolean>

Returns:

a new Mono with true if any value is emitted and false otherwise
hasElements
()

Emit a single boolean true if this Flux sequence has at least one element.

pack-priv static <O> Supplier<Set<O>>
public Flux<T>

Returns:

a new Flux preventing Publisher / Subscription based Reactor optimizations
hide
()

Hides the identities of this Flux instance.

pack-priv static <T> Function<T, T>
public final Mono<T>

Returns:

a new empty Mono representing the completion of this Flux.
ignoreElements
()

Ignores onNext signals (dropping them) and only propagate termination events.

public final Flux<Tuple2<Long, T>>

Returns:

an indexed Flux with each source value combined with its 0-based index.
index
()

Keep information about the order in which source values were received by indexing them with a 0-based incrementing long, returning a Flux of Tuple2<(index, value)>.

public final <I> Flux<I>

Returns:

an indexed Flux with each source value combined with its computed index.
index
(BiFunction<? super Long, ? super T, ? extends I>
the BiFunction to use to combine elements and their index.
indexMapper
)

Keep information about the order in which source values were received by indexing them internally with a 0-based incrementing long then combining this information with the source value into a I using the provided BiFunction, returning a Flux<I>.

public static Flux<Long>

Returns:

a new Flux emitting increasing numbers at regular intervals
interval
(Duration
the period Duration between each increment
period
)

Create a Flux that emits long values starting with 0 and incrementing at specified time intervals on the global timer.

public static Flux<Long>

Returns:

a new Flux emitting increasing numbers at regular intervals
interval
(Duration
the Duration to wait before emitting 0l
delay
,
Duration
the period Duration before each following increment
period
)

Create a Flux that emits long values starting with 0 and incrementing at specified time intervals, after an initial delay, on the global timer.

public static Flux<Long>

Returns:

a new Flux emitting increasing numbers at regular intervals
interval
(Duration
the period Duration between each increment
period
,
Scheduler
a time-capable Scheduler instance to run on
timer
)

Create a Flux that emits long values starting with 0 and incrementing at specified time intervals, on the specified Scheduler.

public static Flux<Long>

Returns:

a new Flux emitting increasing numbers at regular intervals
interval
(Duration
the Duration to wait before emitting 0l
delay
,
Duration
the period Duration before each following increment
period
,
Scheduler
a time-capable Scheduler instance to run on
timer
)

Create a Flux that emits long values starting with 0 and incrementing at specified time intervals, after an initial delay, on the specified Scheduler.

public final <
the type of the elements from the right Publisher
TRight
,
the type for this Flux window signals
TLeftEnd
,
the type for the right Publisher window signals
TRightEnd
,
the combined result type
R
>
Flux<R>

Returns:

a joining Flux
join
(Publisher<? extends TRight>
the other Publisher to correlate items with
other
,
Function<? super T, ? extends Publisher<TLeftEnd>>
a function that returns a Publisher whose emissions indicate the time window for the source value to be considered
leftEnd
,
Function<? super TRight, ? extends Publisher<TRightEnd>>
a function that returns a Publisher whose emissions indicate the time window for the right Publisher value to be considered
rightEnd
,
BiFunction<? super T, ? super TRight, ? extends R>
a function that takes an item emitted by each Publisher and returns the value to be emitted by the resulting Flux
resultSelector
)

Combine values from two Publishers in case their windows overlap.

public static <
the emitted data type
T
>
Flux<T>

Returns:

a new Flux
just
(T...
the elements to emit, as a vararg
data
)

Create a Flux that emits the provided elements and then completes.

public static <
the emitted data type
T
>
Flux<T>

Returns:

a new Flux
just
(T
the single element to emit
data
)

Create a new Flux that will only emit a single element then onComplete.

public final Mono<T>

Returns:

a Mono with the last value in this Flux
last
()

Emit the last element observed before complete signal as a Mono, or emit NoSuchElementException error if the source was empty.

public final Mono<T>

Returns:

a Mono with the last value in this Flux
last
(T
a single fallback item if this Flux is empty
defaultValue
)

Emit the last element observed before complete signal as a Mono, or emit the defaultValue if the source was empty.

public final Flux<T>

Returns:

a Flux limiting downstream's backpressure
limitRate
(int
the limit to apply to downstream's backpressure
prefetchRate
)

Ensure that backpressure signals from downstream subscribers are split into batches capped at the provided prefetchRate when propagated upstream, effectively rate limiting the upstream Publisher.

public final Flux<T>

Returns:

a Flux limiting downstream's backpressure and customizing the replenishment request amount
limitRate
(int
the initial request amount
highTide
,
int
the subsequent (or replenishing) request amount, 0 to disable early replenishing, highTide to revert to a 75% replenish strategy.
lowTide
)

Ensure that backpressure signals from downstream subscribers are split into batches capped at the provided highTide first, then replenishing at the provided lowTide, effectively rate limiting the upstream Publisher.

public final Flux<T>

Returns:

a Flux of n elements from the source, that requests AT MOST n from upstream in total.
limitRequest
(long
the number of elements to emit from this flux, which is also the backpressure cap for all of downstream's request
n
)

Deprecated replace with take(n, true) in 3.4.x, then take(long) in 3.5.0.
Take only the first N values from this Flux, if available.
pack-priv static <O> Supplier<List<O>>
public final Flux<T>

Returns:

a new Flux that logs signals
log
()

Observe all Reactive Streams signals and trace them using Logger support.

public final Flux<T>

Returns:

a new Flux that logs signals
log
(String
to be mapped into logger configuration (e.g. org.springframework .reactor). If category ends with "." like "reactor.", a generated operator suffix will be added, e.g. "reactor.Flux.Map".
category
)

Observe all Reactive Streams signals and trace them using Logger support.

public final Flux<T>

Returns:

a new Flux that logs signals
log
(String
to be mapped into logger configuration (e.g. org.springframework .reactor). If category ends with "." like "reactor.", a generated operator suffix will be added, e.g. "reactor.Flux.Map".
category
,
Level
the Level to enforce for this tracing Flux (only FINEST, FINE, INFO, WARNING and SEVERE are taken into account)
level
,
SignalType...
a vararg SignalType option to filter log messages
options
)

Observe Reactive Streams signals matching the passed filter options and trace them using Logger support.

public final Flux<T>

Returns:

a new Flux that logs signals
log
(String
to be mapped into logger configuration (e.g. org.springframework .reactor). If category ends with "." like "reactor.", a generated operator suffix will be added, e.g. "reactor.Flux.Map".
category
,
Level
the Level to enforce for this tracing Flux (only FINEST, FINE, INFO, WARNING and SEVERE are taken into account)
level
,
boolean
capture the current stack to display operator class/line number.
showOperatorLine
,
SignalType...
a vararg SignalType option to filter log messages
options
)

Observe Reactive Streams signals matching the passed filter options and trace them using Logger support.

public final Flux<T>

Returns:

a new Flux that logs signals
log
(Logger
the Logger to use, instead of resolving one through a category.
logger
)

Observe Reactive Streams signals matching the passed filter options and trace them using a specific user-provided Logger, at Level#INFO level.

public final Flux<T>

Returns:

a new Flux that logs signals
log
(Logger
the Logger to use, instead of resolving one through a category.
logger
,
Level
the Level to enforce for this tracing Flux (only FINEST, FINE, INFO, WARNING and SEVERE are taken into account)
level
,
boolean
capture the current stack to display operator class/line number (default in overload is false).
showOperatorLine
,
SignalType...
a vararg SignalType option to filter log messages
options
)

Observe Reactive Streams signals matching the passed filter options and trace them using a specific user-provided Logger, at the given Level.

public final <
the transformed type
V
>
Flux<V>

Returns:

a transformed Flux
map
(Function<? super T, ? extends V>
the synchronous transforming Function
mapper
)

Transform the items emitted by this Flux by applying a synchronous function to each item.

public final <
the transformed type
V
>
Flux<V>

Returns:

a transformed Flux
mapNotNull
(Function<? super T, ? extends V>
the synchronous transforming Function
mapper
)

Transform the items emitted by this Flux by applying a synchronous function to each item, which may produce null values.

public final Flux<Signal<T>>

Returns:

a Flux of materialized Signal
materialize
()

Transform incoming onNext, onError and onComplete signals into Signal instances, materializing these signals.

public static <
the merged type
T
>
Flux<T>

Returns:

a merged Flux
merge
(Publisher<? extends Publisher<? extends T>>
a Publisher of Publisher sources to merge
source
)

Merge data from Publisher sequences emitted by the passed Publisher into an interleaved merged sequence.

public static <
the merged type
T
>
Flux<T>

Returns:

a merged Flux
merge
(Publisher<? extends Publisher<? extends T>>
a Publisher of Publisher sources to merge
source
,
int
the request produced to the main source thus limiting concurrent merge backlog
concurrency
)

Merge data from Publisher sequences emitted by the passed Publisher into an interleaved merged sequence.

public static <
the merged type
T
>
Flux<T>

Returns:

a merged Flux
merge
(Publisher<? extends Publisher<? extends T>>
a Publisher of Publisher sources to merge
source
,
int
the request produced to the main source thus limiting concurrent merge backlog
concurrency
,
int
the inner source request size
prefetch
)

Merge data from Publisher sequences emitted by the passed Publisher into an interleaved merged sequence.

public static <
The source type of the data sequence
I
>
Flux<I>

Returns:

a merged Flux
merge
(Iterable<? extends Publisher<? extends I>>
the Iterable of sources to merge (will be lazily iterated on subscribe)
sources
)

Merge data from Publisher sequences contained in an Iterable into an interleaved merged sequence.

public static <
The source type of the data sequence
I
>
Flux<I>

Returns:

a merged Flux
merge
(Publisher<? extends I>...
the array of Publisher sources to merge
sources
)

Merge data from Publisher sequences contained in an array / vararg into an interleaved merged sequence.

public static <
The source type of the data sequence
I
>
Flux<I>

Returns:

a fresh Reactive Flux publisher ready to be subscribed
merge
(int
the inner source request size
prefetch
,
Publisher<? extends I>...
the array of Publisher sources to merge
sources
)

Merge data from Publisher sequences contained in an array / vararg into an interleaved merged sequence.

pack-priv static <I> Flux<I>
merge(int prefetch, boolean delayError, Publisher<? extends I>... sources)

public static <
a Comparable merged type that has a natural order
I extends Comparable<? super I>
>
Flux<I>

Returns:

a merged Flux that , subscribing early but keeping the original ordering
mergeComparing
(Publisher<? extends I>...
Publisher sources of Comparable to merge
sources
)

Merge data from provided Publisher sequences into an ordered merged sequence, by picking the smallest values from each source (as defined by their natural order).

public static <
the merged type
T
>
Flux<T>

Returns:

a merged Flux that compares latest values from each source, using the smallest value and replenishing the source that produced it
mergeComparing
(Comparator<? super T>
the Comparator to use to find the smallest value
comparator
,
Publisher<? extends T>...
Publisher sources to merge
sources
)

Merge data from provided Publisher sequences into an ordered merged sequence, by picking the smallest values from each source (as defined by the provided Comparator).

public static <
the merged type
T
>
Flux<T>

Returns:

a merged Flux that compares latest values from each source, using the smallest value and replenishing the source that produced it
mergeComparing
(int
the number of elements to prefetch from each source (avoiding too many small requests to the source when picking)
prefetch
,
Comparator<? super T>
the Comparator to use to find the smallest value
comparator
,
Publisher<? extends T>...
Publisher sources to merge
sources
)

Merge data from provided Publisher sequences into an ordered merged sequence, by picking the smallest values from each source (as defined by the provided Comparator).

public static <
the merged type
T
>
Flux<T>

Returns:

a merged Flux that compares latest values from each source, using the smallest value and replenishing the source that produced it
mergeComparingDelayError
(int
the number of elements to prefetch from each source (avoiding too many small requests to the source when picking)
prefetch
,
Comparator<? super T>
the Comparator to use to find the smallest value
comparator
,
Publisher<? extends T>...
Publisher sources to merge
sources
)

Merge data from provided Publisher sequences into an ordered merged sequence, by picking the smallest values from each source (as defined by the provided Comparator).

public final Flux<T>

Returns:

a new Flux that compares latest values from the given publisher and this flux, using the smallest value and replenishing the source that produced it
mergeComparingWith
(Publisher<? extends T>
the Publisher to merge with
other
,
Comparator<? super T>
the Comparator to use for merging
otherComparator
)

Merge data from this Flux and a Publisher into a reordered merge sequence, by picking the smallest value from each sequence as defined by a provided Comparator.

public static <
The source type of the data sequence
I
>
Flux<I>

Returns:

a fresh Reactive Flux publisher ready to be subscribed
mergeDelayError
(int
the inner source request size
prefetch
,
Publisher<? extends I>...
the array of Publisher sources to merge
sources
)

Merge data from Publisher sequences contained in an array / vararg into an interleaved merged sequence.

public static <
a Comparable merged type that has a natural order
I extends Comparable<? super I>
>
Flux<I>

Returns:

a merged Flux that compares latest values from each source, using the smallest value and replenishing the source that produced it
mergeOrdered
(Publisher<? extends I>...
Publisher sources of Comparable to merge
sources
)

Deprecated Use mergeComparingDelayError(int, Comparator, Publisher[]) instead (as mergeComparing(Publisher[]) don't have this operator's delayError behavior).
Merge data from provided Publisher sequences into an ordered merged sequence, by picking the smallest values from each source (as defined by their natural order).
public static <
the merged type
T
>
Flux<T>

Returns:

a merged Flux that compares latest values from each source, using the smallest value and replenishing the source that produced it
mergeOrdered
(Comparator<? super T>
the Comparator to use to find the smallest value
comparator
,
Publisher<? extends T>...
Publisher sources to merge
sources
)

Deprecated Use mergeComparingDelayError(int, Comparator, Publisher[]) instead (as mergeComparing(Publisher[]) don't have this operator's delayError behavior).
Merge data from provided Publisher sequences into an ordered merged sequence, by picking the smallest values from each source (as defined by the provided Comparator).
public static <
the merged type
T
>
Flux<T>

Returns:

a merged Flux that compares latest values from each source, using the smallest value and replenishing the source that produced it
mergeOrdered
(int
the number of elements to prefetch from each source (avoiding too many small requests to the source when picking)
prefetch
,
Comparator<? super T>
the Comparator to use to find the smallest value
comparator
,
Publisher<? extends T>...
Publisher sources to merge
sources
)

Deprecated Use mergeComparingDelayError(int, Comparator, Publisher[]) instead (as mergeComparing(Publisher[]) don't have this operator's delayError behavior).
Merge data from provided Publisher sequences into an ordered merged sequence, by picking the smallest values from each source (as defined by the provided Comparator).
public final Flux<T>

Returns:

a new Flux that compares latest values from the given publisher and this flux, using the smallest value and replenishing the source that produced it
mergeOrderedWith
(Publisher<? extends T>
the Publisher to merge with
other
,
Comparator<? super T>
the Comparator to use for merging
otherComparator
)

Deprecated Use mergeComparingWith(Publisher, Comparator) instead (with the caveat that it defaults to NOT delaying errors, unlike this operator).
Merge data from this Flux and a Publisher into a reordered merge sequence, by picking the smallest value from each sequence as defined by a provided Comparator.
public static <
a Comparable merged type that has a natural order
I extends Comparable<? super I>
>
Flux<I>

Returns:

a merged Flux that compares the latest available value from each source, publishing the smallest value and replenishing the source that produced it.
mergePriority
(Publisher<? extends I>...
Publisher sources of Comparable to merge
sources
)

Merge data from provided Publisher sequences into an ordered merged sequence, by picking the smallest values from each source (as defined by their natural order) as they arrive.

public static <
the merged type
T
>
Flux<T>

Returns:

a merged Flux that compares the latest available value from each source, publishing the smallest value and replenishing the source that produced it.
mergePriority
(Comparator<? super T>
the Comparator to use to find the smallest value
comparator
,
Publisher<? extends T>...
Publisher sources to merge
sources
)

Merge data from provided Publisher sequences into an ordered merged sequence, by picking the smallest values from each source (as defined by the provided Comparator) as they arrive.

public static <
the merged type
T
>
Flux<T>

Returns:

a merged Flux that compares the latest available value from each source, publishing the smallest value and replenishing the source that produced it.
mergePriority
(int
the number of elements to prefetch from each source (avoiding too many small requests to the source when picking)
prefetch
,
Comparator<? super T>
the Comparator to use to find the smallest value
comparator
,
Publisher<? extends T>...
Publisher sources to merge
sources
)

Merge data from provided Publisher sequences into an ordered merged sequence, by picking the smallest values from each source (as defined by the provided Comparator) as they arrive.

public static <
the merged type
T
>
Flux<T>

Returns:

a merged Flux that compares the latest available value from each source, publishing the smallest value and replenishing the source that produced it.
mergePriorityDelayError
(int
the number of elements to prefetch from each source (avoiding too many small requests to the source when picking)
prefetch
,
Comparator<? super T>
the Comparator to use to find the smallest value
comparator
,
Publisher<? extends T>...
Publisher sources to merge
sources
)

Merge data from provided Publisher sequences into an ordered merged sequence, by picking the smallest values from each source (as defined by the provided Comparator) as they arrive.

public static <
the merged type
T
>
Flux<T>

Returns:

a merged Flux, subscribing early but keeping the original ordering
mergeSequential
(Publisher<? extends Publisher<? extends T>>
a Publisher of Publisher sources to merge
sources
)

Merge data from Publisher sequences emitted by the passed Publisher into an ordered merged sequence.

public static <
the merged type
T
>
Flux<T>

Returns:

a merged Flux, subscribing early but keeping the original ordering
mergeSequential
(Publisher<? extends Publisher<? extends T>>
a Publisher of Publisher sources to merge
sources
,
int
the request produced to the main source thus limiting concurrent merge backlog
maxConcurrency
,
int
the inner source request size
prefetch
)

Merge data from Publisher sequences emitted by the passed Publisher into an ordered merged sequence.

public static <
the merged type
I
>
Flux<I>

Returns:

a merged Flux, subscribing early but keeping the original ordering
mergeSequential
(Publisher<? extends I>...
a number of Publisher sequences to merge
sources
)

Merge data from Publisher sequences provided in an array/vararg into an ordered merged sequence.

public static <
the merged type
I
>
Flux<I>

Returns:

a merged Flux, subscribing early but keeping the original ordering
mergeSequential
(int
the inner source request size
prefetch
,
Publisher<? extends I>...
a number of Publisher sequences to merge
sources
)

Merge data from Publisher sequences provided in an array/vararg into an ordered merged sequence.

public static <
the merged type
I
>
Flux<I>

Returns:

a merged Flux, subscribing early but keeping the original ordering
mergeSequential
(Iterable<? extends Publisher<? extends I>>
an Iterable of Publisher sequences to merge
sources
)

Merge data from Publisher sequences provided in an Iterable into an ordered merged sequence.

public static <
the merged type
I
>
Flux<I>

Returns:

a merged Flux, subscribing early but keeping the original ordering
mergeSequential
(Iterable<? extends Publisher<? extends I>>
an Iterable of Publisher sequences to merge
sources
,
int
the request produced to the main source thus limiting concurrent merge backlog
maxConcurrency
,
int
the inner source request size
prefetch
)

Merge data from Publisher sequences provided in an Iterable into an ordered merged sequence.

pack-priv static <I> Flux<I>
mergeSequential(int prefetch, boolean delayError, Publisher<? extends I>... sources)

pack-priv static <T> Flux<T>
mergeSequential(Publisher<? extends Publisher<? extends T>> sources, boolean delayError, int maxConcurrency, int prefetch)

pack-priv static <I> Flux<I>
mergeSequential(Iterable<? extends Publisher<? extends I>> sources, boolean delayError, int maxConcurrency, int prefetch)

public static <
the merged type
T
>
Flux<T>

Returns:

a merged Flux, subscribing early but keeping the original ordering
mergeSequentialDelayError
(Publisher<? extends Publisher<? extends T>>
a Publisher of Publisher sources to merge
sources
,
int
the request produced to the main source thus limiting concurrent merge backlog
maxConcurrency
,
int
the inner source request size
prefetch
)

Merge data from Publisher sequences emitted by the passed Publisher into an ordered merged sequence.

public static <
the merged type
I
>
Flux<I>

Returns:

a merged Flux, subscribing early but keeping the original ordering
mergeSequentialDelayError
(int
the inner source request size
prefetch
,
Publisher<? extends I>...
a number of Publisher sequences to merge
sources
)

Merge data from Publisher sequences provided in an array/vararg into an ordered merged sequence.

public static <
the merged type
I
>
Flux<I>

Returns:

a merged Flux, subscribing early but keeping the original ordering
mergeSequentialDelayError
(Iterable<? extends Publisher<? extends I>>
an Iterable of Publisher sequences to merge
sources
,
int
the request produced to the main source thus limiting concurrent merge backlog
maxConcurrency
,
int
the inner source request size
prefetch
)

Merge data from Publisher sequences provided in an Iterable into an ordered merged sequence.

public final Flux<T>

Returns:

a new Flux
mergeWith
(Publisher<? extends T>
the Publisher to merge with
other
)

Merge data from this Flux and a Publisher into an interleaved merged sequence.

public final Flux<T>

Returns:

an instrumented Flux
metrics
()

Deprecated Prefer using the tap(SignalListenerFactory) with the SignalListenerFactory provided by the new reactor-core-micrometer module.
Activate metrics for this sequence, provided there is an instrumentation facade on the classpath (otherwise this method is a pure no-op).
public final Flux<T>

Returns:

the same sequence, but bearing a name
name
(String
a name for the sequence
name
)

Give a name to this sequence, which can be retrieved using Scannable#name() as long as this is the first reachable Scannable#parents().

public static <
the Subscriber type target
T
>
Flux<T>

Returns:

a never completing Flux
never
()

Create a Flux that will never signal any data, error or completion signal.

public final Mono<T>

Returns:

a new Mono emitting the first value in this Flux
next
()

Emit only the first item emitted by this Flux, into a new Mono.

public final <U> Flux<U>

Returns:

a new Flux filtered on items of the requested type
ofType
(final Class<U>
the Class type to test values against
clazz
)

Evaluate each accepted value against the given Class type.

protected static <
the value type
T
>
Flux<T>

Returns:

the source, potentially wrapped with assembly time cross-cutting behavior
onAssembly
(Flux<T>
the source to apply assembly hooks onto
source
)

To be used by custom operators: invokes assembly Hooks pointcut given a Flux, potentially returning a new Flux.

protected static <
the value type
T
>
ConnectableFlux<T>

Returns:

the source, potentially wrapped with assembly time cross-cutting behavior
onAssembly
(ConnectableFlux<T>
the source to apply assembly hooks onto
source
)

To be used by custom operators: invokes assembly Hooks pointcut given a ConnectableFlux, potentially returning a new ConnectableFlux.

public final Flux<T>

Returns:

a backpressured Flux that buffers with unbounded capacity
onBackpressureBuffer
()

Request an unbounded demand and push to the returned Flux, or park the observed elements if not enough demand is requested downstream.

public final Flux<T>

Returns:

a backpressured Flux that buffers with bounded capacity
onBackpressureBuffer
(int
maximum number of elements overflowing request before the source is cancelled
maxSize
)

Request an unbounded demand and push to the returned Flux, or park up to maxSize elements when not enough demand is requested downstream.

public final Flux<T>

Returns:

a backpressured Flux that buffers with a bounded capacity
onBackpressureBuffer
(int
maximum number of elements overflowing request before callback is called and source is cancelled
maxSize
,
Consumer<? super T>
callback to invoke on overflow
onOverflow
)

Request an unbounded demand and push to the returned Flux, or park up to maxSize elements when not enough demand is requested downstream.

public final Flux<T>

Returns:

a backpressured Flux that buffers up to a capacity then applies an overflow strategy
onBackpressureBuffer
(int
maximum buffer backlog size before overflow strategy is applied
maxSize
,
BufferOverflowStrategy
strategy to apply to overflowing elements
bufferOverflowStrategy
)

Request an unbounded demand and push to the returned Flux, or park the observed elements if not enough demand is requested downstream, within a maxSize limit.

public final Flux<T>

Returns:

a backpressured Flux that buffers up to a capacity then applies an overflow strategy
onBackpressureBuffer
(int
maximum buffer backlog size before overflow callback is called
maxSize
,
Consumer<? super T>
callback to invoke on overflow
onBufferOverflow
,
BufferOverflowStrategy
strategy to apply to overflowing elements
bufferOverflowStrategy
)

Request an unbounded demand and push to the returned Flux, or park the observed elements if not enough demand is requested downstream, within a maxSize limit.

public final Flux<T>

Returns:

a backpressured Flux that buffers with a TTL and up to a capacity then applies an overflow strategy
onBackpressureBuffer
(Duration
maximum Duration for which an element is kept in the backlog
ttl
,
int
maximum buffer backlog size before overflow callback is called
maxSize
,
Consumer<? super T>
callback to invoke once TTL is reached or on overflow
onBufferEviction
)

Request an unbounded demand and push to the returned Flux, or park the observed elements if not enough demand is requested downstream, within a maxSize limit and for a maximum Duration of ttl (as measured on the parallel Scheduler).

public final Flux<T>

Returns:

a backpressured Flux that buffers with a TTL and up to a capacity then applies an overflow strategy
onBackpressureBuffer
(Duration
maximum Duration for which an element is kept in the backlog
ttl
,
int
maximum buffer backlog size before overflow callback is called
maxSize
,
Consumer<? super T>
callback to invoke once TTL is reached or on overflow
onBufferEviction
,
Scheduler
the scheduler on which to run the timeout check
scheduler
)

Request an unbounded demand and push to the returned Flux, or park the observed elements if not enough demand is requested downstream, within a maxSize limit and for a maximum Duration of ttl (as measured on the provided Scheduler).

public final Flux<T>

Returns:

a backpressured Flux that drops overflowing elements
onBackpressureDrop
()

Request an unbounded demand and push to the returned Flux, or drop the observed elements if not enough demand is requested downstream.

public final Flux<T>

Returns:

a backpressured Flux that drops overflowing elements
onBackpressureDrop
(Consumer<? super T>
the Consumer called when a value gets dropped due to lack of downstream requests
onDropped
)

Request an unbounded demand and push to the returned Flux, or drop and notify dropping Consumer with the observed elements if not enough demand is requested downstream.

public final Flux<T>

Returns:

a backpressured Flux that errors on overflowing elements
onBackpressureError
()

Request an unbounded demand and push to the returned Flux, or emit onError fom Exceptions#failWithOverflow if not enough demand is requested downstream.

public final Flux<T>

Returns:

a backpressured Flux that will only keep a reference to the last observed item
onBackpressureLatest
()

Request an unbounded demand and push to the returned Flux, or only keep the most recent observed item if not enough demand is requested downstream.

public final Flux<T>

Returns:

a new Flux falling back on completion when an onError occurs
onErrorComplete
()

Simply complete the sequence by replacing an onError signal with an onComplete signal.

public final Flux<T>

Returns:

a new Flux falling back on completion when a matching error occurs
onErrorComplete
(Class<? extends Throwable> type)

Simply complete the sequence by replacing an onError signal with an onComplete signal if the error matches the given Class.

public final Flux<T>

Returns:

a new Flux falling back on completion when a matching error occurs
onErrorComplete
(Predicate<? super Throwable> predicate)

Simply complete the sequence by replacing an onError signal with an onComplete signal if the error matches the given Predicate.

public final Flux<T>

Returns:

a Flux that attempts to continue processing on errors.
onErrorContinue
(BiConsumer<Throwable, Object>
a BiConsumer fed with errors matching the predicate and the value that triggered the error.
errorConsumer
)

Let compatible operators upstream recover from errors by dropping the incriminating element from the sequence and continuing with subsequent elements.

public final <E extends Throwable> Flux<T>

Returns:

a Flux that attempts to continue processing on some errors.
onErrorContinue
(Class<E>
the Class of Exception that are resumed from.
type
,
BiConsumer<Throwable, Object>
a BiConsumer fed with errors matching the Class and the value that triggered the error.
errorConsumer
)

Let compatible operators upstream recover from errors by dropping the incriminating element from the sequence and continuing with subsequent elements.

public final <E extends Throwable> Flux<T>

Returns:

a Flux that attempts to continue processing on some errors.
onErrorContinue
(Predicate<E>
a Predicate used to filter which errors should be resumed from. This MUST be idempotent, as it can be used several times.
errorPredicate
,
BiConsumer<Throwable, Object>
a BiConsumer fed with errors matching the predicate and the value that triggered the error.
errorConsumer
)

Let compatible operators upstream recover from errors by dropping the incriminating element from the sequence and continuing with subsequent elements.

public final Flux<T>

Returns:

a Flux that transforms source errors to other errors
onErrorMap
(Function<? super Throwable, ? extends Throwable>
the error transforming Function
mapper
)

Transform any error emitted by this Flux by synchronously applying a function to it.

public final <
the error type
E extends Throwable
>
Flux<T>

Returns:

a Flux that transforms some source errors to other errors
onErrorMap
(Class<E>
the class of the exception type to react to
type
,
Function<? super E, ? extends Throwable>
the error transforming Function
mapper
)

Transform an error emitted by this Flux by synchronously applying a function to it if the error matches the given type.

public final Flux<T>

Returns:

a Flux that transforms some source errors to other errors
onErrorMap
(Predicate<? super Throwable>
the error predicate
predicate
,
Function<? super Throwable, ? extends Throwable>
the error transforming Function
mapper
)

Transform an error emitted by this Flux by synchronously applying a function to it if the error matches the given predicate.

public final Flux<T>

Returns:

a Flux falling back upon source onError
onErrorResume
(Function<? super Throwable, ? extends Publisher<? extends T>>
the function to choose the fallback to an alternative Publisher
fallback
)

Subscribe to a returned fallback publisher when any error occurs, using a function to choose the fallback depending on the error.

public final <
the error type
E extends Throwable
>
Flux<T>

Returns:

a Flux falling back upon source onError
onErrorResume
(Class<E>
the error type to match
type
,
Function<? super E, ? extends Publisher<? extends T>>
the function to choose the fallback to an alternative Publisher
fallback
)

Subscribe to a fallback publisher when an error matching the given type occurs, using a function to choose the fallback depending on the error.

public final Flux<T>

Returns:

a Flux falling back upon source onError
onErrorResume
(Predicate<? super Throwable>
the error predicate to match
predicate
,
Function<? super Throwable, ? extends Publisher<? extends T>>
the function to choose the fallback to an alternative Publisher
fallback
)

Subscribe to a fallback publisher when an error matching a given predicate occurs.

public final Flux<T>

Returns:

a new falling back Flux
onErrorReturn
(T
the value to emit if an error occurs
fallbackValue
)

Simply emit a captured fallback value when any error is observed on this Flux.

public final <
the error type
E extends Throwable
>
Flux<T>

Returns:

a new falling back Flux
onErrorReturn
(Class<E>
the error type to match
type
,
T
the value to emit if an error occurs that matches the type
fallbackValue
)

Simply emit a captured fallback value when an error of the specified type is observed on this Flux.

public final Flux<T>

Returns:

a new falling back Flux
onErrorReturn
(Predicate<? super Throwable>
the error predicate to match
predicate
,
T
the value to emit if an error occurs that matches the predicate
fallbackValue
)

Simply emit a captured fallback value when an error matching the given predicate is observed on this Flux.

public final Flux<T>

Returns:

a Flux that terminates on errors, even if onErrorContinue(BiConsumer) was used downstream
onErrorStop
()

If an onErrorContinue(BiConsumer) variant has been used downstream, reverts to the default 'STOP' mode where errors are terminal events upstream.

public final Flux<T>

Returns:

a detachable Flux
onTerminateDetach
()

Detaches both the child Subscriber and the Subscription on termination or cancellation.

public final Flux<T>

Returns:

the fastest sequence
or
(Publisher<? extends T>
the Publisher to race with
other
)

Pick the first Publisher between this Flux and another publisher to emit any signal (onNext/onError/onComplete) and replay all signals from that Publisher, effectively behaving like the fastest of these competing sources.

public final ParallelFlux<T>

Returns:

a new ParallelFlux instance
parallel
()

Prepare this Flux by dividing data on a number of 'rails' matching the number of CPU cores, in a round-robin fashion.

public final ParallelFlux<T>

Returns:

a new ParallelFlux instance
parallel
(int
the number of parallel rails
parallelism
)

Prepare this Flux by dividing data on a number of 'rails' matching the provided parallelism parameter, in a round-robin fashion.

public final ParallelFlux<T>

Returns:

a new ParallelFlux instance
parallel
(int
the number of parallel rails
parallelism
,
int
the number of values to prefetch from the source
prefetch
)

Prepare this Flux by dividing data on a number of 'rails' matching the provided parallelism parameter, in a round-robin fashion and using a custom prefetch amount and queue for dealing with the source Flux's values.

public final ConnectableFlux<T>

Returns:

a new ConnectableFlux
publish
()

Prepare a ConnectableFlux which shares this Flux sequence and dispatches values to subscribers in a backpressure-aware manner.

public final ConnectableFlux<T>

Returns:

a new ConnectableFlux
publish
(int
bounded requested demand
prefetch
)

Prepare a ConnectableFlux which shares this Flux sequence and dispatches values to subscribers in a backpressure-aware manner.

public final <
the output value type
R
>
Flux<R>

Returns:

a new Flux
publish
(Function<? super Flux<T>, ? extends Publisher<? extends R>>
the transformation function
transform
)

Shares a sequence for the duration of a function that may transform it and consume it as many times as necessary without causing multiple subscriptions to the upstream.

public final <
the output value type
R
>
Flux<R>

Returns:

a new Flux
publish
(Function<? super Flux<T>, ? extends Publisher<? extends R>>
the transformation function
transform
,
int
the request size
prefetch
)

Shares a sequence for the duration of a function that may transform it and consume it as many times as necessary without causing multiple subscriptions to the upstream.

public final Mono<T>

Returns:

a new Mono
publishNext
()

Deprecated use shareNext() instead, or use `publish().next()` if you need to `connect().
Prepare a Mono which shares this Flux sequence and dispatches the first observed item to subscribers in a backpressure-aware manner.
public final Flux<T>

Returns:

a Flux producing asynchronously on a given Scheduler
publishOn
(Scheduler
a Scheduler providing the Worker where to publish
scheduler
)

Run onNext, onComplete and onError on a supplied Scheduler Worker.

public final Flux<T>

Returns:

a Flux producing asynchronously
publishOn
(Scheduler
a Scheduler providing the Worker where to publish
scheduler
,
int
the asynchronous boundary capacity
prefetch
)

Run onNext, onComplete and onError on a supplied Scheduler Worker.

public final Flux<T>

Returns:

a Flux producing asynchronously
publishOn
(Scheduler
a Scheduler providing the Worker where to publish
scheduler
,
boolean
should the buffer be consumed before forwarding any error
delayError
,
int
the asynchronous boundary capacity
prefetch
)

Run onNext, onComplete and onError on a supplied Scheduler Worker.

pack-priv final Flux<T>
publishOn(Scheduler scheduler, boolean delayError, int prefetch, int lowTide)

public static <
The type of values in the sequence
T
>
Flux<T>

Returns:

a Flux
push
(Consumer<? super FluxSink<T>>
Consume the FluxSink provided per-subscriber by Reactor to generate signals.
emitter
)

Programmatically create a Flux with the capability of emitting multiple elements from a single-threaded producer through the FluxSink API.

public static <
The type of values in the sequence
T
>
Flux<T>

Returns:

a Flux
push
(Consumer<? super FluxSink<T>>
Consume the FluxSink provided per-subscriber by Reactor to generate signals.
emitter
,
FluxSink.OverflowStrategy
the backpressure mode, see OverflowStrategy for the available backpressure modes
backpressure
)

Programmatically create a Flux with the capability of emitting multiple elements from a single-threaded producer through the FluxSink API.

public static Flux<Integer>

Returns:

a ranged Flux
range
(int
the first integer to be emit
start
,
int
the total number of incrementing values to emit, including the first value
count
)

Build a Flux that will only emit a sequence of count incrementing integers, starting from start.

public final Mono<T>

Returns:

a reduced Flux
reduce
(BiFunction<T, T, T>
the reducing BiFunction
aggregator
)

Reduce the values from this Flux sequence into a single object of the same type than the emitted items.

public final <
the type of the seed and the reduced object
A
>
Mono<A>

Returns:

a reduced Flux
reduce
(A
the seed, the initial leftmost argument to pass to the reducing BiFunction
initial
,
BiFunction<A, ? super T, A>
the reducing BiFunction
accumulator
)

Reduce the values from this Flux sequence into a single object matching the type of a seed value.

public final <
the type of the seed and the reduced object
A
>
Mono<A>

Returns:

a reduced Flux
reduceWith
(Supplier<A>
a Supplier of the seed, called on subscription and passed to the the reducing BiFunction
initial
,
BiFunction<A, ? super T, A>
the reducing BiFunction
accumulator
)

Reduce the values from this Flux sequence into a single object matching the type of a lazily supplied seed value.

public final Flux<T>

Returns:

an indefinitely repeated Flux on onComplete
repeat
()

Repeatedly and indefinitely subscribe to the source upon completion of the previous subscription.

public final Flux<T>

Returns:

a Flux that repeats on onComplete while the predicate matches
repeat
(BooleanSupplier
the boolean to evaluate on onComplete.
predicate
)

Repeatedly subscribe to the source if the predicate returns true after completion of the previous subscription.

public final Flux<T>

Returns:

a Flux that repeats on onComplete, up to the specified number of repetitions
repeat
(long
the number of times to re-subscribe on onComplete (positive, or 0 for original sequence only)
numRepeat
)

Repeatedly subscribe to the source numRepeat times.

public final Flux<T>

Returns:

a Flux that repeats on onComplete while the predicate matches, up to the specified number of repetitions
repeat
(long
the number of times to re-subscribe on complete (positive, or 0 for original sequence only)
numRepeat
,
BooleanSupplier
the boolean to evaluate on onComplete
predicate
)

Repeatedly subscribe to the source if the predicate returns true after completion of the previous subscription.

public final Flux<T>

Returns:

a Flux that repeats on onComplete when the companion Publisher produces an onNext signal
repeatWhen
(Function<Flux<Long>, ? extends Publisher<?>>
the Function that returns the associated Publisher companion, given a Flux that signals each onComplete as a Long representing the number of source elements emitted in the latest attempt.
repeatFactory
)

Repeatedly subscribe to this Flux when a companion sequence emits elements in response to the flux completion signal.

public final ConnectableFlux<T>

Returns:

a replaying ConnectableFlux
replay
()

Turn this Flux into a hot source and cache last emitted signals for further Subscriber.

public final ConnectableFlux<T>

Returns:

a replaying ConnectableFlux
replay
(int
number of events retained in history excluding complete and error
history
)

Turn this Flux into a connectable hot source and cache last emitted signals for further Subscriber.

public final ConnectableFlux<T>

Returns:

a replaying ConnectableFlux
replay
(Duration
Per-item and post termination timeout duration
ttl
)

Turn this Flux into a connectable hot source and cache last emitted signals for further Subscriber.

public final ConnectableFlux<T>

Returns:

a replaying ConnectableFlux
replay
(int
number of events retained in history excluding complete and error
history
,
Duration
Per-item and post termination timeout duration
ttl
)

Turn this Flux into a connectable hot source and cache last emitted signals for further Subscriber.

public final ConnectableFlux<T>

Returns:

a replaying ConnectableFlux
replay
(Duration
Per-item and post termination timeout duration
ttl
,
Scheduler
a time-capable Scheduler instance to read current time from
timer
)

Turn this Flux into a connectable hot source and cache last emitted signals for further Subscriber.

public final ConnectableFlux<T>

Returns:

a replaying ConnectableFlux
replay
(int
number of events retained in history excluding complete and error
history
,
Duration
Per-item and post termination timeout duration
ttl
,
Scheduler
a Scheduler instance to read current time from
timer
)

Turn this Flux into a connectable hot source and cache last emitted signals for further Subscriber.

public final Flux<T>

Returns:

a Flux that retries on onError
retry
()

Re-subscribes to this Flux sequence if it signals any error, indefinitely.

public final Flux<T>

Returns:

a Flux that retries on onError up to the specified number of retry attempts.
retry
(long
the number of times to tolerate an error
numRetries
)

Re-subscribes to this Flux sequence if it signals any error, for a fixed number of times.

public final Flux<T>

Returns:

a Flux that retries on onError when a companion Publisher produces an onNext signal
retryWhen
(Retry
the Retry strategy that will generate the companion Publisher, given a Flux that signals each onError as a reactor.util.retry.Retry.RetrySignal.
retrySpec
)

Retries this Flux in response to signals emitted by a companion Publisher.

public final Flux<T>

Returns:

a Flux sampled to the last item seen over each periodic window
sample
(Duration
the duration of the window after which to emit the latest observed item
timespan
)

Sample this Flux by periodically emitting an item corresponding to that Flux latest emitted value within the periodical time window.

public final <
the type of the sampler sequence
U
>
Flux<T>

Returns:

a Flux sampled to the last item observed each time the sampler Publisher signals
sample
(Publisher<U>
the sampler companion Publisher
sampler
)

Sample this Flux by emitting an item corresponding to that Flux latest emitted value whenever a companion sampler Publisher signals a value.

public final Flux<T>

Returns:

a Flux sampled to the first item of each duration-based window
sampleFirst
(Duration
the duration during which to skip values after each sample
timespan
)

Repeatedly take a value from this Flux then skip the values that follow within a given duration.

public final <
the companion reified type
U
>
Flux<T>

Returns:

a Flux sampled to the first item observed in each window closed by the sampler signals
sampleFirst
(Function<? super T, ? extends Publisher<U>>
supply a companion sampler Publisher which signals the end of the skip window
samplerFactory
)

Repeatedly take a value from this Flux then skip the values that follow before the next signal from a companion sampler Publisher.

public final <
the companion reified type
U
>
Flux<T>

Returns:

a Flux sampled to items not followed by any other item within a window defined by a companion Publisher
sampleTimeout
(Function<? super T, ? extends Publisher<U>>
supply a companion sampler Publisher which signals the end of the window during which no new emission should occur. If it is the case, the original value triggering the window is emitted.
throttlerFactory
)

Emit the latest value from this Flux only if there were no new values emitted during the window defined by a companion Publisher derived from that particular value.

public final <
the throttling type
U
>
Flux<T>

Returns:

a Flux sampled to items not followed by any other item within a window defined by a companion Publisher
sampleTimeout
(Function<? super T, ? extends Publisher<U>>
supply a companion sampler Publisher which signals the end of the window during which no new emission should occur. If it is the case, the original value triggering the window is emitted.
throttlerFactory
,
int
the maximum number of concurrent timeouts
maxConcurrency
)

Emit the latest value from this Flux only if there were no new values emitted during the window defined by a companion Publisher derived from that particular value.

public final Flux<T>

Returns:

an accumulating Flux
scan
(BiFunction<T, T, T>
the accumulating BiFunction
accumulator
)

Reduce this Flux values with an accumulator BiFunction and also emit the intermediate results of this function.

public final <
the accumulated type
A
>
Flux<A>

Returns:

an accumulating Flux starting with initial state
scan
(A
the initial leftmost argument to pass to the reduce function
initial
,
BiFunction<A, ? super T, A>
the accumulating BiFunction
accumulator
)

Reduce this Flux values with an accumulator BiFunction and also emit the intermediate results of this function.

public final <
the accumulated type
A
>
Flux<A>

Returns:

an accumulating Flux starting with initial state
scanWith
(Supplier<A>
the supplier providing the seed, the leftmost parameter initially passed to the reduce function
initial
,
BiFunction<A, ? super T, A>
the accumulating BiFunction
accumulator
)

Reduce this Flux values with the help of an accumulator BiFunction and also emits the intermediate results.

public final Flux<T>

Returns:

a Flux that upon first subscribe causes the source Flux to subscribe once, late subscribers might therefore miss items.
share
()

Returns a new Flux that multicasts (shares) the original Flux.

public final Mono<T>

Returns:

a new Mono
shareNext
()

Prepare a Mono which shares this Flux sequence and dispatches the first observed item to subscribers.

public final Mono<T>

Returns:

a Mono with the single item or an error signal
single
()

Expect and emit a single item from this Flux source or signal java.util.NoSuchElementException for an empty source, or IndexOutOfBoundsException for a source with more than one element.

public final Mono<T>

Returns:

a Mono with the expected single item, the supplied default value or an error signal
single
(T
a single fallback item if this Flux is empty
defaultValue
)

Expect and emit a single item from this Flux source and emit a default value for an empty source, but signal an IndexOutOfBoundsException for a source with more than one element.

public final Mono<T>

Returns:

a Mono with the expected single item, no item or an error
singleOrEmpty
()

Expect and emit a single item from this Flux source, and accept an empty source but signal an IndexOutOfBoundsException for a source with more than one element.

public final Flux<T>

Returns:

a dropping Flux with the specified number of elements skipped at the beginning
skip
(long
the number of elements to drop
skipped
)

Skip the specified number of elements from the beginning of this Flux then emit the remaining elements.

public final Flux<T>

Returns:

a Flux dropping at the beginning until the end of the given duration
skip
(Duration
the initial time window during which to drop elements
timespan
)

Skip elements from this Flux emitted within the specified initial duration.

public final Flux<T>

Returns:

a Flux dropping at the beginning for the given duration
skip
(Duration
the initial time window during which to drop elements
timespan
,
Scheduler
a time-capable Scheduler instance to measure the time window on
timer
)

Skip elements from this Flux emitted within the specified initial duration, as measured on the provided Scheduler.

public final Flux<T>

Returns:

a Flux dropping the specified number of elements at the end of the sequence
skipLast
(int
the number of elements to drop before completion
n
)

Skip a specified number of elements at the end of this Flux sequence.

public final Flux<T>

Returns:

a Flux dropping until the Predicate matches
skipUntil
(Predicate<? super T>
the Predicate evaluated to stop skipping.
untilPredicate
)

Skips values from this Flux until a Predicate returns true for the value.

public final Flux<T>

Returns:

a Flux dropping until the other Publisher emits
skipUntilOther
(Publisher<?>
the companion Publisher to coordinate with to stop skipping
other
)

Skip values from this Flux until a specified Publisher signals an onNext or onComplete.

public final Flux<T>

Returns:

a Flux dropping while the Predicate matches
skipWhile
(Predicate<? super T>
the Predicate that causes skipping while evaluating to true.
skipPredicate
)

Skips values from this Flux while a Predicate returns true for the value.

public final Flux<T>

Returns:

a sorted Flux
sort
()

Sort elements from this Flux by collecting and sorting them in the background then emitting the sorted sequence once this sequence completes.

public final Flux<T>

Returns:

a sorted Flux
sort
(Comparator<? super T>
a function that compares two items emitted by this Flux to indicate their sort order
sortFunction
)

Sort elements from this Flux using a Comparator function, by collecting and sorting elements in the background then emitting the sorted sequence once this sequence completes.

public final Flux<T>

Returns:

a new Flux prefixed with elements from an Iterable
startWith
(Iterable<? extends T>
the sequence of values to start the resulting Flux with
iterable
)

Prepend the given Iterable before this Flux sequence.

public final Flux<T>

Returns:

a new Flux prefixed with the given elements
startWith
(T...
the array of values to start the resulting Flux with
values
)

Prepend the given values before this Flux sequence.

public final Flux<T>

Returns:

a new Flux prefixed with the given Publisher sequence
startWith
(Publisher<? extends T>
the Publisher whose values to prepend
publisher
)

Prepend the given Publisher sequence to this Flux sequence.

public final Disposable

Returns:

a new Disposable that can be used to cancel the underlying Subscription
subscribe
()

Subscribe to this Flux and request unbounded demand.

public final Disposable

Returns:

a new Disposable that can be used to cancel the underlying Subscription
subscribe
(Consumer<? super T>
the consumer to invoke on each value (onNext signal)
consumer
)

Subscribe a Consumer to this Flux that will consume all the elements in the sequence.

public final Disposable

Returns:

a new Disposable that can be used to cancel the underlying Subscription
subscribe
(Consumer<? super T>
the consumer to invoke on each next signal
consumer
,
Consumer<? super Throwable>
the consumer to invoke on error signal
errorConsumer
)

Subscribe to this Flux with a Consumer that will consume all the elements in the sequence, as well as a Consumer that will handle errors.

public final Disposable

Returns:

a new Disposable that can be used to cancel the underlying Subscription
subscribe
(Consumer<? super T>
the consumer to invoke on each value
consumer
,
Consumer<? super Throwable>
the consumer to invoke on error signal
errorConsumer
,
Runnable
the consumer to invoke on complete signal
completeConsumer
)

Subscribe Consumer to this Flux that will respectively consume all the elements in the sequence, handle errors and react to completion.

public final Disposable

Returns:

a new Disposable that can be used to cancel the underlying Subscription
subscribe
(Consumer<? super T>
the consumer to invoke on each value
consumer
,
Consumer<? super Throwable>
the consumer to invoke on error signal
errorConsumer
,
Runnable
the consumer to invoke on complete signal
completeConsumer
,
Consumer<? super Subscription>
the consumer to invoke on subscribe signal, to be used for the initial request, or null for max request
subscriptionConsumer
)

Deprecated Because users tend to forget to request the subsciption.
Subscribe Consumer to this Flux that will respectively consume all the elements in the sequence, handle errors, react to completion, and request upon subscription.
public final Disposable

Returns:

a new Disposable that can be used to cancel the underlying Subscription
subscribe
(Consumer<? super T>
the consumer to invoke on each value
consumer
,
Consumer<? super Throwable>
the consumer to invoke on error signal
errorConsumer
,
Runnable
the consumer to invoke on complete signal
completeConsumer
,
Context
the base Context tied to the subscription that will be visible to operators upstream
initialContext
)

Subscribe Consumer to this Flux that will respectively consume all the elements in the sequence, handle errors and react to completion.

public final void
subscribe(Subscriber<? super T>
the Subscriber that will consume signals from this Publisher
actual
)

Implements org.reactivestreams.Publisher.subscribe.

Request Publisher to start streaming data.
public abstract void
subscribe(CoreSubscriber<? super T>
the Subscriber interested into the published sequence
actual
)

Redeclares reactor.core.CorePublisher.subscribe.

An internal Publisher#subscribe(Subscriber) that will bypass Hooks#onLastOperator(Function) pointcut.
public final Flux<T>

Returns:

a Flux requesting asynchronously
subscribeOn
(Scheduler
a Scheduler providing the Worker where to subscribe
scheduler
)

Run subscribe, onSubscribe and request on a specified Scheduler's Worker.

public final Flux<T>

Returns:

a Flux requesting asynchronously
subscribeOn
(Scheduler
a Scheduler providing the Worker where to subscribe
scheduler
,
boolean
whether or not to also perform requests on the worker. true to behave like subscribeOn(Scheduler)
requestOnSeparateThread
)

Run subscribe and onSubscribe on a specified Scheduler's Worker.

public final <
the reified type from the input/output subscriber
E extends Subscriber<? super T>
>
E

Returns:

the passed Subscriber
subscribeWith
(E
the Subscriber to subscribe with and return
subscriber
)

Subscribe a provided instance of a subclass of Subscriber to this Flux and return said instance for further chaining calls.

public final Flux<T>

Returns:

a new Flux that falls back on a Publisher if source is empty
switchIfEmpty
(Publisher<? extends T>
the alternative Publisher if this sequence is empty
alternate
)

Switch to an alternative Publisher if this sequence is completed without any data.

public final <
the type of the return value of the transformation function
V
>
Flux<V>

Returns:

a new Flux that emits values from an alternative Publisher for each source onNext
switchMap
(Function<? super T, Publisher<? extends V>>
the Function to generate a Publisher for each source value
fn
)

Switch to a new Publisher generated via a Function whenever this Flux produces an item.

public final <
the type of the return value of the transformation function
V
>
Flux<V>

Returns:

a new Flux that emits values from an alternative Publisher for each source onNext
switchMap
(Function<? super T, Publisher<? extends V>>
the Function to generate a Publisher for each source value
fn
,
int
the produced demand for inner sources
prefetch
)

Deprecated to be removed in 3.6.0 at the earliest. In 3.5.0, you should replace calls with prefetch=0 with calls to switchMap(fn), as the default behavior of the single-parameter variant will then change to prefetch=0.
Switch to a new Publisher generated via a Function whenever this Flux produces an item.
public final <
the item type in the returned Flux
V
>
Flux<V>

Returns:

a new Flux that transform the upstream once a signal is available
switchOnFirst
(BiFunction<Signal<? extends T>, Flux<T>, Publisher<? extends V>>
A BiFunction executed once the first signal is available and used to transform the source conditionally. The whole source (including first signal) is passed as second argument to the BiFunction.
transformer
)

Transform the current Flux once it emits its first element, making a conditional transformation possible.

public final <
the item type in the returned Flux
V
>
Flux<V>

Returns:

a new Flux that transform the upstream once a signal is available
switchOnFirst
(BiFunction<Signal<? extends T>, Flux<T>, Publisher<? extends V>>
A BiFunction executed once the first signal is available and used to transform the source conditionally. The whole source (including first signal) is passed as second argument to the BiFunction.
transformer
,
boolean
specify whether original publisher should be cancelled on onComplete from the derived one
cancelSourceOnComplete
)

Transform the current Flux once it emits its first element, making a conditional transformation possible.

public static <
the produced type
T
>
Flux<T>

Returns:

a SinkManyAbstractBase accepting publishers and producing T
switchOnNext
(Publisher<? extends Publisher<? extends T>>
The Publisher of Publisher to switch on and mirror.
mergedPublishers
)

Creates a Flux that mirrors the most recently emitted Publisher, forwarding its data until a new Publisher comes in the source.

public static <
the produced type
T
>
Flux<T>

Returns:

a SinkManyAbstractBase accepting publishers and producing T
switchOnNext
(Publisher<? extends Publisher<? extends T>>
The Publisher of Publisher to switch on and mirror.
mergedPublishers
,
int
the inner source request size
prefetch
)

Deprecated to be removed in 3.6.0 at the earliest. In 3.5.0, you should replace calls with prefetch=0 with calls to switchOnNext(mergedPublishers), as the default behavior of the single-parameter variant will then change to prefetch=0.
Creates a Flux that mirrors the most recently emitted Publisher, forwarding its data until a new Publisher comes in the source.
public final Flux<T>

Returns:

the same sequence, but bearing tags
tag
(String
a tag key
key
,
String
a tag value
value
)

Tag this flux with a key/value pair.

public final Flux<T>

Returns:

a Flux limited to size N
take
(long
the maximum number of items to request from upstream and emit from this Flux
n
)

Take only the first N values from this Flux, if available.

public final Flux<T>

Returns:

a Flux limited to size N
take
(long
the number of items to emit from this Flux
n
,
boolean
true to follow the downstream request more closely and limit the upstream request to n. false to request an unbounded amount from upstream.
limitRequest
)

Take only the first N values from this Flux, if available.

public final Flux<T>

Returns:

a Flux limited to elements emitted within a specific duration
take
(Duration
the Duration of the time window during which to emit elements from this Flux
timespan
)

Relay values from this Flux until the specified Duration elapses.

public final Flux<T>

Returns:

a Flux limited to elements emitted within a specific duration
take
(Duration
the Duration of the time window during which to emit elements from this Flux
timespan
,
Scheduler
a time-capable Scheduler instance to run on
timer
)

Relay values from this Flux until the specified Duration elapses, as measured on the specified Scheduler.

public final Flux<T>

Returns:

a terminating Flux sub-sequence
takeLast
(int
the number of items from this Flux to retain and emit on onComplete
n
)

Emit the last N values this Flux emitted before its completion.

public final Flux<T>

Returns:

a new Flux limited by the predicate
takeUntil
(Predicate<? super T>
the Predicate that stops the taking of values from this Flux when returning true.
predicate
)

Relay values from this Flux until the given Predicate matches.

public final Flux<T>

Returns:

a new Flux limited by a companion Publisher
takeUntilOther
(Publisher<?>
the companion Publisher that signals when to stop taking values from this Flux
other
)

Relay values from this Flux until the given Publisher emits.

public final Flux<T>

Returns:

a new Flux taking values from the source while the predicate matches
takeWhile
(Predicate<? super T>
the Predicate invoked each onNext returning TRUE to relay a value or FALSE to terminate
continuePredicate
)

Relay values from this Flux while a predicate returns TRUE for the values (checked before each value is delivered).

public final Flux<T>

Returns:

a new Flux with side effects defined by generated SignalListener
tap
(Supplier<SignalListener<T>>
the Supplier to create a new SignalListener on each subscription
simpleListenerGenerator
)

Tap into Reactive Streams signals emitted or received by this Flux and notify a stateful per-Subscriber SignalListener.

public final Flux<T>

Returns:

a new Flux with side effects defined by generated SignalListener
tap
(Function<ContextView, SignalListener<T>>
the Function to create a new SignalListener on each subscription
listenerGenerator
)

Tap into Reactive Streams signals emitted or received by this Flux and notify a stateful per-Subscriber SignalListener.

public final Flux<T>

Returns:

a new Flux with side effects defined by generated SignalListener
tap
(SignalListenerFactory<T, ?>
the SignalListenerFactory to create a new SignalListener on each subscription
listenerFactory
)

Tap into Reactive Streams signals emitted or received by this Flux and notify a stateful per-Subscriber SignalListener created by the provided SignalListenerFactory.

public final Mono<Void>

Returns:

a new Mono representing the termination of this Flux
then
()

Return a Mono<Void> that completes when this Flux completes.

public final <
the element type of the supplied Mono
V
>
Mono<V>

Returns:

a new Flux that wait for source completion then emits from the supplied Mono
then
(Mono<V>
a Mono to emit from after termination
other
)

Let this Flux complete then play signals from a provided Mono.

public final Mono<Void>

Returns:

a new Mono completing when both publishers have completed in sequence
thenEmpty
(Publisher<Void>
a Publisher to wait for after this Flux's termination
other
)

Return a Mono<Void> that waits for this Flux to complete then for a supplied Publisher<Void> to also complete.

public final <
the element type of the supplied Publisher
V
>
Flux<V>

Returns:

a new Flux that emits from the supplied Publisher after this Flux completes.
thenMany
(Publisher<V>
a Publisher to emit from after termination
other
)

Let this Flux complete then play another Publisher.

public final Flux<Timed<T>>

Returns:

a timed Flux
timed
()

Times Subscriber#onNext(Object) events, encapsulated into a Timed object that lets downstream consumer look at various time information gathered with nanosecond resolution using the default clock (Schedulers#parallel()):

public final Flux<Timed<T>>

Returns:

a timed Flux
timed
(Scheduler clock)

Times Subscriber#onNext(Object) events, encapsulated into a Timed object that lets downstream consumer look at various time information gathered with nanosecond resolution using the provided Scheduler as a clock:

public final Flux<T>

Returns:

a Flux that can time out on a per-item basis
timeout
(Duration
the timeout between two signals from this Flux
timeout
)

Propagate a TimeoutException as soon as no item is emitted within the given Duration from the previous emission (or the subscription for the first item).

public final Flux<T>

Returns:

a Flux that will fallback to a different Publisher in case of a per-item timeout
timeout
(Duration
the timeout between two signals from this Flux
timeout
,
Publisher<? extends T>
the fallback Publisher to subscribe when a timeout occurs
fallback
)

Switch to a fallback Flux as soon as no item is emitted within the given Duration from the previous emission (or the subscription for the first item).

public final Flux<T>

Returns:

a Flux that can time out on a per-item basis
timeout
(Duration
the timeout Duration between two signals from this Flux
timeout
,
Scheduler
a time-capable Scheduler instance to run on
timer
)

Propagate a TimeoutException as soon as no item is emitted within the given Duration from the previous emission (or the subscription for the first item), as measured by the specified Scheduler.

public final Flux<T>

Returns:

a Flux that will fallback to a different Publisher in case of a per-item timeout
timeout
(Duration
the timeout Duration between two signals from this Flux
timeout
,
Publisher<? extends T>
the fallback Publisher to subscribe when a timeout occurs
fallback
,
Scheduler
a time-capable Scheduler instance to run on
timer
)

Switch to a fallback Flux as soon as no item is emitted within the given Duration from the previous emission (or the subscription for the first item), as measured on the specified Scheduler.

public final <
the type of the timeout Publisher
U
>
Flux<T>

Returns:

a Flux that can time out if the first item does not come before a signal from a companion Publisher
timeout
(Publisher<U>
the companion Publisher that will trigger a timeout if emitting before the first signal from this Flux
firstTimeout
)

Signal a TimeoutException in case the first item from this Flux has not been emitted before the given Publisher emits.

public final <
the type of the elements of the first timeout Publisher
U
,
the type of the elements of the subsequent timeout Publishers
V
>
Flux<T>

Returns:

a Flux that can time out if each element does not come before a signal from a per-item companion Publisher
timeout
(Publisher<U>
the timeout Publisher that must not emit before the first signal from this Flux
firstTimeout
,
Function<? super T, ? extends Publisher<V>>
the timeout Publisher factory for each next item
nextTimeoutFactory
)

Signal a TimeoutException in case the first item from this Flux has not been emitted before the firstTimeout Publisher emits, and whenever each subsequent elements is not emitted before a Publisher generated from the latest element signals.

private <U, V> Flux<T>
timeout(Publisher<U> firstTimeout, Function<? super T, ? extends Publisher<V>> nextTimeoutFactory, String timeoutDescription)

public final <
the type of the elements of the first timeout Publisher
U
,
the type of the elements of the subsequent timeout Publishers
V
>
Flux<T>

Returns:

a Flux that can time out if each element does not come before a signal from a per-item companion Publisher
timeout
(Publisher<U>
the timeout Publisher that must not emit before the first signal from this Flux
firstTimeout
,
Function<? super T, ? extends Publisher<V>>
the timeout Publisher factory for each next item
nextTimeoutFactory
,
Publisher<? extends T>
the fallback Publisher to subscribe when a timeout occurs
fallback
)

Switch to a fallback Publisher in case the first item from this Flux has not been emitted before the firstTimeout Publisher emits, and whenever each subsequent elements is not emitted before a Publisher generated from the latest element signals.

public final Flux<Tuple2<Long, T>>

Returns:

a timestamped Flux
timestamp
()

Emit a reactor.util.function.Tuple2 pair of T1 the current clock time in millis (as a Long measured by the parallel Scheduler) and T2 the emitted data (as a T), for each item from this Flux.

public final Flux<Tuple2<Long, T>>

Returns:

a timestamped Flux
timestamp
(Scheduler
the Scheduler to read time from
scheduler
)

Emit a reactor.util.function.Tuple2 pair of T1 the current clock time in millis (as a Long measured by the provided Scheduler) and T2 the emitted data (as a T), for each item from this Flux.

public final Iterable<T>

Returns:

a blocking Iterable
toIterable
()

Transform this Flux into a lazy Iterable blocking on Iterator#next() calls.

public final Iterable<T>

Returns:

a blocking Iterable
toIterable
(int
the bounded capacity to prefetch from this Flux or Integer.MAX_VALUE for unbounded demand
batchSize
)

Transform this Flux into a lazy Iterable blocking on Iterator#next() calls.

public final Iterable<T>

Returns:

a blocking Iterable
toIterable
(int
the bounded capacity to prefetch from this Flux or Integer.MAX_VALUE for unbounded demand
batchSize
,
Supplier<Queue<T>>
the supplier of the queue implementation to be used for storing elements emitted faster than the iteration
queueProvider
)

Transform this Flux into a lazy Iterable blocking on Iterator#next() calls.

public final Stream<T>

Returns:

a Stream of unknown size with onClose attached to Subscription#cancel()
toStream
()

Transform this Flux into a lazy Stream blocking for each source onNext call.

public final Stream<T>

Returns:

a Stream of unknown size with onClose attached to Subscription#cancel()
toStream
(int
the bounded capacity to prefetch from this Flux or Integer.MAX_VALUE for unbounded demand
batchSize
)

Transform this Flux into a lazy Stream blocking for each source onNext call.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public final <
the item type in the returned Flux
V
>
Flux<V>

Returns:

a new Flux
transform
(Function<? super Flux<T>, ? extends Publisher<V>>
the Function to immediately map this Flux into a target Flux instance.
transformer
)

Transform this Flux in order to generate a target Flux.

public final <
the item type in the returned Publisher
V
>
Flux<V>

Returns:

a new Flux
transformDeferred
(Function<? super Flux<T>, ? extends Publisher<V>>
the Function to lazily map this Flux into a target Publisher instance for each new subscriber
transformer
)

Defer the transformation of this Flux in order to generate a target Flux type.

public final <
the item type in the returned Publisher
V
>
Flux<V>

Returns:

a new Flux
transformDeferredContextual
(BiFunction<? super Flux<T>, ? super ContextView, ? extends Publisher<V>>
the BiFunction to lazily map this Flux into a target Flux instance upon subscription, with access to ContextView
transformer
)

Defer the given transformation to this Flux in order to generate a target Flux type.

pack-priv static <A, B> BiFunction<A, B, Tuple2<A, B>>
public static <
emitted type
T
,
resource type
D
>
Flux<T>

Returns:

a new Flux built around a disposable resource
using
(Callable<? extends D>
a Callable that is called on subscribe to generate the resource
resourceSupplier
,
Function<? super D, ? extends Publisher<? extends T>>
a factory to derive a Publisher from the supplied resource
sourceSupplier
,
Consumer<? super D>
a resource cleanup callback invoked on completion
resourceCleanup
)

Uses a resource, generated by a supplier for each individual Subscriber, while streaming the values from a Publisher derived from the same resource and makes sure the resource is released if the sequence terminates or the Subscriber cancels.

public static <
emitted type
T
,
resource type
D
>
Flux<T>

Returns:

a new Flux built around a disposable resource
using
(Callable<? extends D>
a Callable that is called on subscribe to generate the resource
resourceSupplier
,
Function<? super D, ? extends Publisher<? extends T>>
a factory to derive a Publisher from the supplied resource
sourceSupplier
,
Consumer<? super D>
a resource cleanup callback invoked on completion
resourceCleanup
,
boolean
true to clean before terminating downstream subscribers
eager
)

Uses a resource, generated by a supplier for each individual Subscriber, while streaming the values from a Publisher derived from the same resource and makes sure the resource is released if the sequence terminates or the Subscriber cancels.

public static <
the type of elements emitted by the resource closure, and thus the main sequence
T
,
the type of the resource object
D
>
Flux<T>

Returns:

a new Flux built around a "transactional" resource, with asynchronous cleanup on all terminations (onComplete, onError, cancel)
usingWhen
(Publisher<D>
a Publisher that "generates" the resource, subscribed for each subscription to the main sequence
resourceSupplier
,
Function<? super D, ? extends Publisher<? extends T>>
a factory to derive a Publisher from the supplied resource
resourceClosure
,
Function<? super D, ? extends Publisher<?>>
an asynchronous resource cleanup invoked when the resource closure terminates (with onComplete, onError or cancel)
asyncCleanup
)

Uses a resource, generated by a Publisher for each individual Subscriber, while streaming the values from a Publisher derived from the same resource.

public static <
the type of elements emitted by the resource closure, and thus the main sequence
T
,
the type of the resource object
D
>
Flux<T>

Returns:

a new Flux built around a "transactional" resource, with several termination path triggering asynchronous cleanup sequences
usingWhen
(Publisher<D>
a Publisher that "generates" the resource, subscribed for each subscription to the main sequence
resourceSupplier
,
Function<? super D, ? extends Publisher<? extends T>>
a factory to derive a Publisher from the supplied resource
resourceClosure
,
Function<? super D, ? extends Publisher<?>>
an asynchronous resource cleanup invoked if the resource closure terminates with onComplete
asyncComplete
,
BiFunction<? super D, ? super Throwable, ? extends Publisher<?>>
an asynchronous resource cleanup invoked if the resource closure terminates with onError. The terminating error is provided to the BiFunction
asyncError
,
Function<? super D, ? extends Publisher<?>>
an asynchronous resource cleanup invoked if the resource closure is cancelled. When null, the asyncComplete path is used instead.
asyncCancel
)

Uses a resource, generated by a Publisher for each individual Subscriber, while streaming the values from a Publisher derived from the same resource.

public final Flux<Flux<T>>

Returns:

a Flux of Flux windows based on element count
window
(int
the maximum number of items to emit in the window before closing it
maxSize
)

Split this Flux sequence into multiple Flux windows containing maxSize elements (or less for the final window) and starting from the first item.

public final Flux<Flux<T>>

Returns:

a Flux of Flux windows based on element count and opened every skipCount
window
(int
the maximum number of items to emit in the window before closing it
maxSize
,
int
the number of items to count before opening and emitting a new window
skip
)

Split this Flux sequence into multiple Flux windows of size maxSize, that each open every skip elements in the source.

public final Flux<Flux<T>>

Returns:

a Flux of Flux windows delimited by a given Publisher
window
(Publisher<?>
a Publisher to emit any item for a split signal and complete to terminate
boundary
)

Split this Flux sequence into continuous, non-overlapping windows where the window boundary is signalled by another Publisher

<img class="marble" src="doc-files/marbles/windowWithBoundary.svg" alt="">

Note that windows are a live view of part of the underlying source publisher, and as such their lifecycle is tied to that source.

public final Flux<Flux<T>>

Returns:

a Flux of Flux windows continuously opened for a given Duration
window
(Duration
the Duration to delimit Flux windows
windowingTimespan
)

Split this Flux sequence into continuous, non-overlapping windows that open for a windowingTimespan Duration (as measured on the parallel Scheduler).

public final Flux<Flux<T>>

Returns:

a Flux of Flux windows opened at regular intervals and closed after a Duration
window
(Duration
the maximum Flux window Duration
windowingTimespan
,
Duration
the period of time at which to create new Flux windows
openWindowEvery
)

Split this Flux sequence into multiple Flux windows that open for a given windowingTimespan Duration, after which it closes with onComplete.

public final Flux<Flux<T>>

Returns:

a Flux of Flux windows continuously opened for a given Duration
window
(Duration
the Duration to delimit Flux windows
windowingTimespan
,
Scheduler
a time-capable Scheduler instance to run on
timer
)

Split this Flux sequence into continuous, non-overlapping windows that open for a windowingTimespan Duration (as measured on the provided Scheduler).

public final Flux<Flux<T>>

Returns:

a Flux of Flux windows opened at regular intervals and closed after a Duration
window
(Duration
the maximum Flux window Duration
windowingTimespan
,
Duration
the period of time at which to create new Flux windows
openWindowEvery
,
Scheduler
a time-capable Scheduler instance to run on
timer
)

Split this Flux sequence into multiple Flux windows that open for a given windowingTimespan Duration, after which it closes with onComplete.

public final Flux<Flux<T>>

Returns:

a Flux of Flux windows based on element count and duration
windowTimeout
(int
the maximum number of items to emit in the window before closing it
maxSize
,
Duration
the maximum Duration since the window was opened before closing it
maxTime
)

Split this Flux sequence into multiple Flux windows containing maxSize elements (or less for the final window) and starting from the first item.

public final Flux<Flux<T>>

Returns:

a Flux of Flux windows based on element count and duration
windowTimeout
(int
the maximum number of items to emit in the window before closing it
maxSize
,
Duration
the maximum Duration since the window was opened before closing it
maxTime
,
boolean
define whether operator request unbounded demand or prefetch by maxSize
fairBackpressure
)

Split this Flux sequence into multiple Flux windows containing maxSize elements (or less for the final window) and starting from the first item.

public final Flux<Flux<T>>

Returns:

a Flux of Flux windows based on element count and duration
windowTimeout
(int
the maximum number of items to emit in the window before closing it
maxSize
,
Duration
the maximum Duration since the window was opened before closing it
maxTime
,
Scheduler
a time-capable Scheduler instance to run on
timer
)

Split this Flux sequence into multiple Flux windows containing maxSize elements (or less for the final window) and starting from the first item.

public final Flux<Flux<T>>

Returns:

a Flux of Flux windows based on element count and duration
windowTimeout
(int
the maximum number of items to emit in the window before closing it
maxSize
,
Duration
the maximum Duration since the window was opened before closing it
maxTime
,
Scheduler
a time-capable Scheduler instance to run on
timer
,
boolean
define whether operator request unbounded demand or prefetch by maxSize
fairBackpressure
)

Split this Flux sequence into multiple Flux windows containing maxSize elements (or less for the final window) and starting from the first item.

public final Flux<Flux<T>>

Returns:

a Flux of Flux windows, bounded depending on the predicate.
windowUntil
(Predicate<T>
a predicate that triggers the next window when it becomes true.
boundaryTrigger
)

Split this Flux sequence into multiple Flux windows delimited by the given predicate.

public final Flux<Flux<T>>

Returns:

a Flux of Flux windows, bounded depending on the predicate.
windowUntil
(Predicate<T>
a predicate that triggers the next window when it becomes true.
boundaryTrigger
,
boolean
set to true to include the triggering element in the new window rather than the old.
cutBefore
)

Split this Flux sequence into multiple Flux windows delimited by the given predicate.

public final Flux<Flux<T>>

Returns:

a Flux of Flux windows, bounded depending on the predicate.
windowUntil
(Predicate<T>
a predicate that triggers the next window when it becomes true.
boundaryTrigger
,
boolean
set to true to include the triggering element in the new window rather than the old.
cutBefore
,
int
the request size to use for this Flux.
prefetch
)

Split this Flux sequence into multiple Flux windows delimited by the given predicate and using a prefetch.

public final Flux<Flux<T>>

Returns:

a microbatched Flux of Flux windows.
windowUntilChanged
()

Collect subsequent repetitions of an element (that is, if they arrive right after one another) into multiple Flux windows.

public final <V> Flux<Flux<T>>

Returns:

a microbatched Flux of Flux windows.
windowUntilChanged
(Function<? super T, ? super V>
function to compute comparison key for each element
keySelector
)

Collect subsequent repetitions of an element (that is, if they arrive right after one another), as compared by a key extracted through the user provided Function, into multiple Flux windows.

public final <V> Flux<Flux<T>>

Returns:

a microbatched Flux of Flux windows.
windowUntilChanged
(Function<? super T, ? extends V>
function to compute comparison key for each element
keySelector
,
BiPredicate<? super V, ? super V>
predicate used to compare keys
keyComparator
)

Collect subsequent repetitions of an element (that is, if they arrive right after one another), as compared by a key extracted through the user provided Function and compared using a supplied BiPredicate, into multiple Flux windows.

public final <
the type of the sequence opening windows
U
,
the type of the sequence closing windows opened by the bucketOpening Publisher's elements
V
>
Flux<Flux<T>>

Returns:

a Flux of Flux windows opened by signals from a first Publisher and lasting until a selected second Publisher emits
windowWhen
(Publisher<U>
a Publisher that opens a new window when it emits any item
bucketOpening
,
final Function<? super U, ? extends Publisher<V>>
a Function given an opening signal and returning a Publisher that will close the window when emitting
closeSelector
)

Split this Flux sequence into potentially overlapping windows controlled by items of a start Publisher and end Publisher derived from the start values.

public final Flux<Flux<T>>

Returns:

a Flux of Flux windows, each containing subsequent elements that all passed a predicate.
windowWhile
(Predicate<T>
a predicate that triggers the next window when it becomes false.
inclusionPredicate
)

Split this Flux sequence into multiple Flux windows that stay open while a given predicate matches the source elements.

public final Flux<Flux<T>>

Returns:

a Flux of Flux windows, each containing subsequent elements that all passed a predicate.
windowWhile
(Predicate<T>
a predicate that triggers the next window when it becomes false.
inclusionPredicate
,
int
the request size to use for this Flux.
prefetch
)

Split this Flux sequence into multiple Flux windows that stay open while a given predicate matches the source elements.

public final <
the other Publisher sequence type
U
,
the result type
R
>
Flux<R>

Returns:

a combined Flux gated by another Publisher
withLatestFrom
(Publisher<? extends U>
the Publisher to combine with
other
,
BiFunction<? super T, ? super U, ? extends R>
the bi-function called with each pair of source and other elements that should return a single value to be emitted
resultSelector
)

Combine the most recently emitted values from both this Flux and another Publisher through a BiFunction and emits the result.

pack-priv static <
input upstream type
I
>
Flux<I>

Returns:

a wrapped Flux
wrap
(Publisher<? extends I>
the Publisher to wrap
source
)

Unchecked wrap of Publisher as Flux, supporting Fuseable sources.

pack-priv static <T> Mono<T>

Returns:

the mono representing that Flux
wrapToMono
(Callable<T>
the supplier Flux
supplier
)

Returns the appropriate Mono instance for a known Supplier Flux, WITHOUT applying hooks (see wrap(Publisher)).

public static <
type of the value from source1
T1
,
type of the value from source2
T2
,
The produced output after transformation by the combinator
O
>
Flux<O>

Returns:

a zipped Flux
zip
(Publisher<? extends T1>
The first Publisher source to zip.
source1
,
Publisher<? extends T2>
The second Publisher source to zip.
source2
,
final BiFunction<? super T1, ? super T2, ? extends O>
The aggregate function that will receive a unique value from each upstream and return the value to signal downstream
combinator
)

Zip two sources together, that is to say wait for all the sources to emit one element and combine these elements once into an output value (constructed by the provided combinator).

public static <
type of the value from source1
T1
,
type of the value from source2
T2
>
Flux<Tuple2<T1, T2>>

Returns:

a zipped Flux
zip
(Publisher<? extends T1>
The first Publisher source to zip.
source1
,
Publisher<? extends T2>
The second Publisher source to zip.
source2
)

Zip two sources together, that is to say wait for all the sources to emit one element and combine these elements once into a Tuple2.

public static <
type of the value from source1
T1
,
type of the value from source2
T2
,
type of the value from source3
T3
>
Flux<Tuple3<T1, T2, T3>>

Returns:

a zipped Flux
zip
(Publisher<? extends T1>
The first upstream Publisher to subscribe to.
source1
,
Publisher<? extends T2>
The second upstream Publisher to subscribe to.
source2
,
Publisher<? extends T3>
The third upstream Publisher to subscribe to.
source3
)

Zip three sources together, that is to say wait for all the sources to emit one element and combine these elements once into a Tuple3.

public static <
type of the value from source1
T1
,
type of the value from source2
T2
,
type of the value from source3
T3
,
type of the value from source4
T4
>
Flux<Tuple4<T1, T2, T3, T4>>

Returns:

a zipped Flux
zip
(Publisher<? extends T1>
The first upstream Publisher to subscribe to.
source1
,
Publisher<? extends T2>
The second upstream Publisher to subscribe to.
source2
,
Publisher<? extends T3>
The third upstream Publisher to subscribe to.
source3
,
Publisher<? extends T4>
The fourth upstream Publisher to subscribe to.
source4
)

Zip four sources together, that is to say wait for all the sources to emit one element and combine these elements once into a Tuple4.

public static <
type of the value from source1
T1
,
type of the value from source2
T2
,
type of the value from source3
T3
,
type of the value from source4
T4
,
type of the value from source5
T5
>
Flux<Tuple5<T1, T2, T3, T4, T5>>

Returns:

a zipped Flux
zip
(Publisher<? extends T1>
The first upstream Publisher to subscribe to.
source1
,
Publisher<? extends T2>
The second upstream Publisher to subscribe to.
source2
,
Publisher<? extends T3>
The third upstream Publisher to subscribe to.
source3
,
Publisher<? extends T4>
The fourth upstream Publisher to subscribe to.
source4
,
Publisher<? extends T5>
The fifth upstream Publisher to subscribe to.
source5
)

Zip five sources together, that is to say wait for all the sources to emit one element and combine these elements once into a Tuple5.

public static <
type of the value from source1
T1
,
type of the value from source2
T2
,
type of the value from source3
T3
,
type of the value from source4
T4
,
type of the value from source5
T5
,
type of the value from source6
T6
>
Flux<Tuple6<T1, T2, T3, T4, T5, T6>>

Returns:

a zipped Flux
zip
(Publisher<? extends T1>
The first upstream Publisher to subscribe to.
source1
,
Publisher<? extends T2>
The second upstream Publisher to subscribe to.
source2
,
Publisher<? extends T3>
The third upstream Publisher to subscribe to.
source3
,
Publisher<? extends T4>
The fourth upstream Publisher to subscribe to.
source4
,
Publisher<? extends T5>
The fifth upstream Publisher to subscribe to.
source5
,
Publisher<? extends T6>
The sixth upstream Publisher to subscribe to.
source6
)

Zip six sources together, that is to say wait for all the sources to emit one element and combine these elements once into a Tuple6.

public static <
type of the value from source1
T1
,
type of the value from source2
T2
,
type of the value from source3
T3
,
type of the value from source4
T4
,
type of the value from source5
T5
,
type of the value from source6
T6
,
type of the value from source7
T7
>
Flux<Tuple7<T1, T2, T3, T4, T5, T6, T7>>

Returns:

a zipped Flux
zip
(Publisher<? extends T1>
The first upstream Publisher to subscribe to.
source1
,
Publisher<? extends T2>
The second upstream Publisher to subscribe to.
source2
,
Publisher<? extends T3>
The third upstream Publisher to subscribe to.
source3
,
Publisher<? extends T4>
The fourth upstream Publisher to subscribe to.
source4
,
Publisher<? extends T5>
The fifth upstream Publisher to subscribe to.
source5
,
Publisher<? extends T6>
The sixth upstream Publisher to subscribe to.
source6
,
Publisher<? extends T7>
The seventh upstream Publisher to subscribe to.
source7
)

Zip seven sources together, that is to say wait for all the sources to emit one element and combine these elements once into a Tuple7.

public static <
type of the value from source1
T1
,
type of the value from source2
T2
,
type of the value from source3
T3
,
type of the value from source4
T4
,
type of the value from source5
T5
,
type of the value from source6
T6
,
type of the value from source7
T7
,
type of the value from source8
T8
>
Flux<Tuple8<T1, T2, T3, T4, T5, T6, T7, T8>>

Returns:

a zipped Flux
zip
(Publisher<? extends T1>
The first upstream Publisher to subscribe to.
source1
,
Publisher<? extends T2>
The second upstream Publisher to subscribe to.
source2
,
Publisher<? extends T3>
The third upstream Publisher to subscribe to.
source3
,
Publisher<? extends T4>
The fourth upstream Publisher to subscribe to.
source4
,
Publisher<? extends T5>
The fifth upstream Publisher to subscribe to.
source5
,
Publisher<? extends T6>
The sixth upstream Publisher to subscribe to.
source6
,
Publisher<? extends T7>
The seventh upstream Publisher to subscribe to.
source7
,
Publisher<? extends T8>
The eight upstream Publisher to subscribe to.
source8
)

Zip eight sources together, that is to say wait for all the sources to emit one element and combine these elements once into a Tuple8.

public static <
the combined produced type
O
>
Flux<O>

Returns:

a zipped Flux
zip
(Iterable<? extends Publisher<?>>
the Iterable providing sources to zip
sources
,
final Function<? super Object[], ? extends O>
The aggregate function that will receive a unique value from each upstream and return the value to signal downstream
combinator
)

Zip multiple sources together, that is to say wait for all the sources to emit one element and combine these elements once into an output value (constructed by the provided combinator).

public static <
the combined produced type
O
>
Flux<O>

Returns:

a zipped Flux
zip
(Iterable<? extends Publisher<?>>
the Iterable providing sources to zip
sources
,
int
the inner source request size
prefetch
,
final Function<? super Object[], ? extends O>
The aggregate function that will receive a unique value from each upstream and return the value to signal downstream
combinator
)

Zip multiple sources together, that is to say wait for all the sources to emit one element and combine these elements once into an output value (constructed by the provided combinator).

public static <
the type of the input sources
I
,
the combined produced type
O
>
Flux<O>

Returns:

a zipped Flux
zip
(final Function<? super Object[], ? extends O>
The aggregate function that will receive a unique value from each upstream and return the value to signal downstream
combinator
,
Publisher<? extends I>...
the array providing sources to zip
sources
)

Zip multiple sources together, that is to say wait for all the sources to emit one element and combine these elements once into an output value (constructed by the provided combinator).

public static <
the type of the input sources
I
,
the combined produced type
O
>
Flux<O>

Returns:

a zipped Flux
zip
(final Function<? super Object[], ? extends O>
The aggregate function that will receive a unique value from each upstream and return the value to signal downstream
combinator
,
int
individual source request size
prefetch
,
Publisher<? extends I>...
the array providing sources to zip
sources
)

Zip multiple sources together, that is to say wait for all the sources to emit one element and combine these elements once into an output value (constructed by the provided combinator).

public static <
the raw tuple type
TUPLE extends Tuple2
,
The produced output after transformation by the given combinator
V
>
Flux<V>

Returns:

a Flux based on the produced value
zip
(Publisher<? extends Publisher<?>>
The Publisher of Publisher sources to zip. A finite publisher is required.
sources
,
final Function<? super TUPLE, ? extends V>
The aggregate function that will receive a unique value from each upstream and return the value to signal downstream
combinator
)

Zip multiple sources together, that is to say wait for all the sources to emit one element and combine these elements once into an output value (constructed by the provided combinator).

public final <
type of the value from source2
T2
>
Flux<Tuple2<T, T2>>

Returns:

a zipped Flux
zipWith
(Publisher<? extends T2>
The second source Publisher to zip with this Flux.
source2
)

Zip this Flux with another Publisher source, that is to say wait for both to emit one element and combine these elements once into a Tuple2.

public final <
type of the value from source2
T2
,
The produced output after transformation by the combinator
V
>
Flux<V>

Returns:

a zipped Flux
zipWith
(Publisher<? extends T2>
The second source Publisher to zip with this Flux.
source2
,
final BiFunction<? super T, ? super T2, ? extends V>
The aggregate function that will receive a unique value from each source and return the value to signal downstream
combinator
)

Zip this Flux with another Publisher source, that is to say wait for both to emit one element and combine these elements using a combinator BiFunction The operator will continue doing so until any of the sources completes.

public final <
type of the value from source2
T2
,
The produced output after transformation by the combinator
V
>
Flux<V>

Returns:

a zipped Flux
zipWith
(Publisher<? extends T2>
The second source Publisher to zip with this Flux.
source2
,
int
the request size to use for this Flux and the other Publisher
prefetch
,
BiFunction<? super T, ? super T2, ? extends V>
The aggregate function that will receive a unique value from each source and return the value to signal downstream
combinator
)

Zip this Flux with another Publisher source, that is to say wait for both to emit one element and combine these elements using a combinator BiFunction The operator will continue doing so until any of the sources completes.

public final <
type of the value from source2
T2
>
Flux<Tuple2<T, T2>>

Returns:

a zipped Flux
zipWith
(Publisher<? extends T2>
The second source Publisher to zip with this Flux.
source2
,
int
the request size to use for this Flux and the other Publisher
prefetch
)

Zip this Flux with another Publisher source, that is to say wait for both to emit one element and combine these elements once into a Tuple2.

public final <
the value type of the other iterable sequence
T2
>
Flux<Tuple2<T, T2>>

Returns:

a zipped Flux
zipWithIterable
(Iterable<? extends T2>
the Iterable to zip with
iterable
)

Zip elements from this Flux with the content of an Iterable, that is to say combine one element from each, pairwise, into a Tuple2.

public final <
the value type of the other iterable sequence
T2
,
the result type
V
>
Flux<V>

Returns:

a zipped Flux
zipWithIterable
(Iterable<? extends T2>
the Iterable to zip with
iterable
,
BiFunction<? super T, ? super T2, ? extends V>
the BiFunction pair combinator
zipper
)

Zip elements from this Flux with the content of an Iterable, that is to say combine one element from each, pairwise, using the given zipper BiFunction.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait