Top Description Fields Constructors Methods
reactor.core.publisher

public abstract Class Mono<T>

extends Object
implements CorePublisher<T>
Class Inheritance
All Implemented Interfaces
reactor.core.CorePublisher, org.reactivestreams.Publisher
Known Direct Subclasses
reactor.core.publisher.MonoCallable, reactor.core.publisher.MonoCompletionStage, reactor.core.publisher.MonoCreate, reactor.core.publisher.MonoIgnorePublisher, reactor.core.publisher.MonoIgnoreThen, reactor.core.publisher.MonoJust, reactor.core.publisher.MonoSingleCallable, reactor.core.publisher.MonoSingleOptionalCallable, reactor.core.publisher.MonoSource, reactor.core.publisher.MonoSourceFuseable, reactor.core.publisher.MonoSubscribeOnCallable, reactor.core.publisher.MonoSubscribeOnValue, reactor.core.publisher.MonoSupplier, reactor.core.publisher.MonoDefer, reactor.core.publisher.MonoDeferContextual, reactor.core.publisher.MonoDelay, reactor.core.publisher.MonoDelayUntil, reactor.core.publisher.MonoEmpty, reactor.core.publisher.MonoError, reactor.core.publisher.MonoErrorSupplied, reactor.core.publisher.MonoFirstWithSignal, reactor.core.publisher.MonoFirstWithValue, reactor.core.publisher.MonoFromFluxOperator, reactor.core.publisher.MonoFromPublisher, reactor.core.publisher.MonoUsing, reactor.core.publisher.MonoUsingWhen, reactor.core.publisher.MonoWhen, reactor.core.publisher.MonoZip, reactor.core.publisher.MonoCurrentContext, reactor.core.publisher.MonoSequenceEqual, reactor.core.publisher.MonoNever, reactor.core.publisher.MonoOperator, reactor.core.publisher.MonoProcessor, reactor.core.publisher.MonoPublishMulticast.MonoPublishMulticaster, reactor.core.publisher.MonoRunnable, reactor.core.publisher.ParallelMergeReduce, reactor.core.publisher.ParallelThen, reactor.core.publisher.SinkEmptyMulticast
Type Parameters
<T>
the type of the single value of this class
Imports
java.time.Duration, java.util.Collection, .Iterator, .List, .NoSuchElementException, .Objects, .Optional, .Set, .Spliterator, java.util.concurrent.Callable, .CompletableFuture, .CompletionStage, .Future, .TimeUnit, .TimeoutException, java.util.function.BiConsumer, .BiFunction, .BiPredicate, .BooleanSupplier, .Consumer, .Function, .LongConsumer, .Predicate, .Supplier, java.util.logging.Level, 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, 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 basic rx operators that emits at most one item via the onNext signal then terminates with an onComplete signal (successful Mono, with or without value), or only emits a single onError signal (failed Mono).

Most Mono implementations are expected to immediately call Subscriber#onComplete() after having called Subscriber#onNext(T). Mono.never() is an outlier: it doesn't emit any signal, which is not technically forbidden although not terribly useful outside of tests. On the other hand, a combination of onNext and onError is explicitly forbidden.

The recommended way to learn about the Mono 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.

The rx operators will offer aliases for input Mono type to preserve the "at most one" property of the resulting Mono. For instance flatMap returns a Mono, while there is a flatMapMany alias with possibly more than 1 emission.

Mono<Void> should be used for Publisher that just completes without any value.

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

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

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

Field Summary

Modifier and TypeField and Description
pack-priv static final BiPredicate<T, U>

Constructor Summary

AccessConstructor and Description
public
Mono()

Method Summary

Modifier and TypeMethod and Description
public final Mono<Void>

Returns:

a new combined Mono
and
(Publisher<?>
the Publisher to wait for complete
other
)

Join the termination signals from this mono and another source into the returned void mono

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

public final <
the returned instance type
P
>
P

Returns:

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

Transform this Mono into a target type.

public T

Returns:

T the result
block
()

Subscribe to this Mono and block indefinitely until a next signal is received.

public T

Returns:

T the result
block
(Duration
maximum time period to wait for before raising a RuntimeException
timeout
)

Subscribe to this Mono and block until a next signal is received or a timeout expires.

public Optional<T>

Returns:

T the result
blockOptional
()

Subscribe to this Mono and block indefinitely until a next signal is received or the Mono completes empty.

public Optional<T>

Returns:

T the result
blockOptional
(Duration
maximum time period to wait for before raising a RuntimeException
timeout
)

Subscribe to this Mono and block until a next signal is received, the Mono completes empty or a timeout expires.

public final Mono<T>

Returns:

a replaying Mono
cache
()

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

public final Mono<T>

Returns:

a replaying Mono
cache
(Duration ttl)

Turn this Mono into a hot source and cache last emitted signals for further Subscriber, with an expiry timeout.

public final Mono<T>

Returns:

a replaying Mono
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 Mono into a hot source and cache last emitted signals for further Subscriber, with an expiry timeout.

public final Mono<T>

Returns:

a replaying Mono
cache
(Function<? super T, Duration>
the TTL-generating Function invoked when source is valued
ttlForValue
,
Function<Throwable, Duration>
the TTL-generating Function invoked when source is erroring
ttlForError
,
Supplier<Duration>
the TTL-generating Supplier invoked when source is empty
ttlForEmpty
)

Turn this Mono into a hot source and cache last emitted signal for further Subscriber, with an expiry timeout (TTL) that depends on said signal.

public final Mono<T>

Returns:

a replaying Mono
cache
(Function<? super T, Duration>
the TTL-generating Function invoked when source is valued
ttlForValue
,
Function<Throwable, Duration>
the TTL-generating Function invoked when source is erroring
ttlForError
,
Supplier<Duration>
the TTL-generating Supplier invoked when source is empty
ttlForEmpty
,
Scheduler
the Scheduler on which to measure the duration.
timer
)

Turn this Mono into a hot source and cache last emitted signal for further Subscriber, with an expiry timeout (TTL) that depends on said signal.

public final Mono<T>

Returns:

a new cached Mono which can be invalidated
cacheInvalidateIf
(Predicate<? super T>
the Predicate used for cache invalidation. Returning true means the value is invalid and should be removed from the cache.
invalidationPredicate
)

Cache onNext signal received from the source and replay it to other subscribers, while allowing invalidation by verifying the cached value against the given Predicate each time a late subscription occurs.

public final Mono<T>

Returns:

a new cached Mono which can be invalidated
cacheInvalidateWhen
(Function<? super T, Mono<Void>>
the Function that generates new Mono<Void> triggers used for invalidation
invalidationTriggerGenerator
)

Cache onNext signal received from the source and replay it to other subscribers, while allowing invalidation via a Mono<Void> companion trigger generated from the currently cached value.

public final Mono<T>

Returns:

a new cached Mono which can be invalidated
cacheInvalidateWhen
(Function<? super T, Mono<Void>>
the Function that generates new Mono<Void> triggers used for invalidation
invalidationTriggerGenerator
,
Consumer<? super T>
the Consumer that will be applied to cached value upon invalidation
onInvalidate
)

Cache onNext signal received from the source and replay it to other subscribers, while allowing invalidation via a Mono<Void> companion trigger generated from the currently cached value.

public final Mono<T>

Returns:

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

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

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

Returns:

a casted Mono
cast
(Class<E>
the target type to cast to
clazz
)

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

public final Mono<T>

Returns:

the assembly tracing Mono
checkpoint
()

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

public final Mono<T>

Returns:

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

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

public final Mono<T>

Returns:

the assembly marked Mono.
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 Flux<T>

Returns:

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

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

public final Mono<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 Mono<T>

Returns:

a contextualized Mono
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 Mono<T>

Returns:

a contextualized Mono
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 static <
The type of the value emitted
T
>
Mono<T>

Returns:

a Mono
create
(Consumer<MonoSink<T>>
Consume the MonoSink provided per-subscriber by Reactor to generate signals.
callback
)

Creates a deferred emitter that can be used with callback-based APIs to signal at most one value, a complete or an error signal.

public final Mono<T>

Returns:

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

Provide a default single value if this mono is completed without any data

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

public static <
the element type of the returned Mono instance
T
>
Mono<T>

Returns:

a deferred Mono
defer
(Supplier<? extends Mono<? extends T>>
a Mono factory
supplier
)

Create a Mono provider that will supply a target Mono to subscribe to for each Subscriber downstream.

public static <
the element type of the returned Mono instance
T
>
Mono<T>

Returns:

a deferred Mono deriving actual Mono from context values for each subscription
deferContextual
(Function<ContextView, ? extends Mono<? extends T>>
a Mono factory
contextualMonoFactory
)

Create a Mono provider that will supply a target Mono to subscribe to for each Subscriber downstream.

public static Mono<Long>

Returns:

a new Mono
delay
(Duration
the duration of the delay
duration
)

Create a Mono which delays an onNext signal by a given duration on a default Scheduler and completes.

public static Mono<Long>

Returns:

a new Mono
delay
(Duration
the Duration of the delay
duration
,
Scheduler
a time-capable Scheduler instance to run on
timer
)

Create a Mono which delays an onNext signal by a given duration on a provided Scheduler and completes.

public final Mono<T>

Returns:

a delayed Mono
delayElement
(Duration
duration by which to delay the Subscriber#onNext signal
delay
)

Delay this Mono element (Subscriber#onNext signal) by a given duration.

public final Mono<T>

Returns:

a delayed Mono
delayElement
(Duration
Duration by which to delay the Subscriber#onNext signal
delay
,
Scheduler
a time-capable Scheduler instance to delay the value signal on
timer
)

Delay this Mono element (Subscriber#onNext signal) by a given Duration, on a particular Scheduler.

public final Mono<T>

Returns:

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

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

public final Mono<T>

Returns:

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

Delay the subscription to this Mono source until the given Duration elapses.

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

Returns:

a delayed Mono
delaySubscription
(Publisher<U>
a Publisher to signal by next or complete this Mono#subscribe(Subscriber)
subscriptionDelay
)

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

public final Mono<T>

Returns:

this Mono, but delayed until the derived publisher terminates.
delayUntil
(Function<? super T, ? extends Publisher<?>>
a Function that maps this Mono's value into a Publisher whose termination will trigger relaying the value.
triggerProvider
)

Subscribe to this Mono and another Publisher that is generated from this Mono's element and which will be used as a trigger for relaying said element.

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

Returns:

a dematerialized Mono
dematerialize
()

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

public final Mono<T>

Returns:

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

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

public final Mono<T>

Returns:

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

Add behavior triggering after the Mono terminates for any reason, including cancellation.

public final Mono<T>

Returns:

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

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

public final Mono<T>

Returns:

a new Mono
doOnCancel
(Runnable
the callback to call on Subscription#cancel()
onCancel
)

Add behavior triggered when the Mono is cancelled.

public final <R> Mono<T>

Returns:

a Mono 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 Mono<T>

Returns:

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

Add behavior triggered when the Mono emits an item, fails with an error or completes successfully.

public final Mono<T>

Returns:

a new Mono
doOnError
(Consumer<? super Throwable>
the error callback to call on Subscriber#onError(Throwable)
onError
)

Add behavior triggered when the Mono completes with an error.

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

Returns:

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

Add behavior triggered when the Mono completes with an error matching the given exception type.

public final Mono<T>

Returns:

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

Add behavior triggered when the Mono completes with an error matching the given predicate.

public final Mono<T>

Returns:

a new Mono
doOnNext
(Consumer<? super T>
the callback to call on Subscriber#onNext
onNext
)

Add behavior triggered when the Mono emits a data successfully.

public final Mono<T>

Returns:

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

Add behavior triggering a LongConsumer when the Mono receives any request.

pack-priv static <T> Mono<T>
doOnSignal(Mono<T> source, Consumer<? super Subscription> onSubscribe, Consumer<? super T> onNext, LongConsumer onRequest, Runnable onCancel)

public final Mono<T>

Returns:

a new Mono
doOnSubscribe
(Consumer<? super Subscription>
the callback to call on Subscriber#onSubscribe(Subscription)
onSubscribe
)

Add behavior (side-effect) triggered when the Mono 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 Mono<T>

Returns:

a new Mono
doOnSuccess
(Consumer<? super T>
the callback to call on, argument is null if the Mono completes without data Subscriber#onNext or Subscriber#onComplete without preceding Subscriber#onNext
onSuccess
)

Add behavior triggered as soon as the Mono can be considered to have completed successfully.

pack-priv static <T> Mono<T>
doOnTerminalSignal(Mono<T> source, Consumer<? super T> onSuccess, Consumer<? super Throwable> onError, BiConsumer<? super T, Throwable> onAfterTerminate)

public final Mono<T>

Returns:

a new Mono
doOnTerminate
(Runnable onTerminate)

Add behavior triggered when the Mono terminates, either by completing with a value, completing empty or failing with an error.

public final Mono<Tuple2<Long, T>>

Returns:

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

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

public final Mono<Tuple2<Long, T>>

Returns:

a new Mono that emits a tuple of time elapsed in milliseconds and matching data
elapsed
(Scheduler
a Scheduler instance to read time from
scheduler
)

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

public static <
the reified Subscriber type
T
>
Mono<T>

Returns:

a completed Mono
empty
()

Create a Mono that completes without emitting any item.

pack-priv static <T> Mono<Void>
empty(Publisher<T> source)

pack-priv static <T> BiPredicate<? super T, ? super T>
public static <
the reified Subscriber type
T
>
Mono<T>

Returns:

a failing Mono
error
(Throwable
the onError signal
error
)

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

public static <
the reified Subscriber type
T
>
Mono<T>

Returns:

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

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

public final Flux<T>

Returns:

this Mono expanded breadth-first to a 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:

this Mono expanded breadth-first to a 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:

this Mono expanded depth-first to a Flux
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:

this Mono expanded depth-first to a Flux
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 Mono<T>

Returns:

a filtered Mono
filter
(final Predicate<? super T>
the predicate to evaluate
tester
)

If this Mono is valued, test the result and replay it if predicate returns true.

public final Mono<T>

Returns:

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

If this Mono is valued, test the value asynchronously using a generated Publisher<Boolean> test.

public static <
The type of the function result.
T
>
Mono<T>

Returns:

a new Mono behaving like the fastest of its sources.
first
(Mono<? extends T>...
The deferred monos to use.
monos
)

Deprecated use firstWithSignal(Mono[]). To be removed in reactor 3.5.
Pick the first Mono to emit any signal (value, empty completion or error) and replay that signal, effectively behaving like the fastest of these competing sources.
public static <
The type of the function result.
T
>
Mono<T>

Returns:

a new Mono behaving like the fastest of its sources.
first
(Iterable<? extends Mono<? extends T>>
The deferred monos to use.
monos
)

Deprecated use firstWithSignal(Iterable). To be removed in reactor 3.5.
Pick the first Mono to emit any signal (value, empty completion or error) and replay that signal, effectively behaving like the fastest of these competing sources.
public static <
The type of the function result.
T
>
Mono<T>

Returns:

a new Mono behaving like the fastest of its sources.
firstWithSignal
(Mono<? extends T>...
The deferred monos to use.
monos
)

Pick the first Mono to emit any signal (value, empty completion or error) and replay that signal, effectively behaving like the fastest of these competing sources.

public static <
The type of the function result.
T
>
Mono<T>

Returns:

a new Mono behaving like the fastest of its sources.
firstWithSignal
(Iterable<? extends Mono<? extends T>>
The deferred monos to use.
monos
)

Pick the first Mono to emit any signal (value, empty completion or error) and replay that signal, effectively behaving like the fastest of these competing sources.

public static <
The type of the element in the sources and the resulting mono
T
>
Mono<T>

Returns:

a new Mono behaving like the fastest of its sources
firstWithValue
(Iterable<? extends Mono<? extends T>>
An Iterable of the competing source monos
monos
)

Pick the first Mono source to emit any value and replay that signal, effectively behaving like the source that first emits an onNext.

public static <
The type of the element in the sources and the resulting mono
T
>
Mono<T>

Returns:

a new Mono behaving like the fastest of its sources
firstWithValue
(Mono<? extends T>
the first competing source Mono
first
,
Mono<? extends T>...
the other competing sources Mono
others
)

Pick the first Mono source to emit any value and replay that signal, effectively behaving like the source that first emits an onNext.

public final <
the result type bound
R
>
Mono<R>

Returns:

a new Mono with an asynchronously mapped value.
flatMap
(Function<? super T, ? extends Mono<? extends R>>
the function to dynamically bind a new Mono
transformer
)

Transform the item emitted by this Mono asynchronously, returning the value emitted by another Mono (possibly changing the value type).

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

Returns:

a merged Flux
flatMapIterable
(Function<? super T, ? extends Iterable<? extends R>>
the Function to transform input item into a sequence Iterable
mapper
)

Transform the item emitted by this Mono into Iterable, then forward its elements into the returned Flux.

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

Returns:

a new Flux as the sequence is not guaranteed to be single at most
flatMapMany
(Function<? super T, ? extends Publisher<? extends R>>
the Function to produce a sequence of R from the eventual passed Subscriber#onNext
mapper
)

Transform the item emitted by this Mono into a Publisher, then forward its emissions into the returned Flux.

public final <
the type of the produced inner sequence
R
>
Flux<R>

Returns:

a new Flux as the sequence is not guaranteed to be single at most
flatMapMany
(Function<? super T, ? extends Publisher<? extends R>>
the Function to call on next data and returning a sequence to merge
mapperOnNext
,
Function<? super Throwable, ? extends Publisher<? extends R>>
the Function to call on error signal and returning a sequence to merge
mapperOnError
,
Supplier<? extends Publisher<? extends R>>
the Function to call on complete signal and returning a sequence to merge
mapperOnComplete
)

Transform the signals emitted by this Mono into signal-specific Publishers, then forward the applicable Publisher's emissions into the returned Flux.

public final Flux<T>

Returns:

a Flux variant of this Mono
flux
()

Convert this Mono to a Flux

public static <
the source type
T
>
Mono<T>

Returns:

the next item emitted as a Mono
from
(Publisher<? extends T>
the Publisher source
source
)

Expose the specified Publisher with the Mono API, and ensure it will emit 0 or 1 item.

public static <
type of the expected value
T
>
Mono<T>

Returns:

A Mono.
fromCallable
(Callable<? extends T>
Callable that will produce the value
supplier
)

Create a Mono producing its value using the provided Callable.

public static <
type of the expected value
T
>
Mono<T>

Returns:

A Mono.
fromCompletionStage
(CompletionStage<? extends T>
CompletionStage that will produce a value (or a null to complete immediately)
completionStage
)

Create a Mono, producing its value using the provided CompletionStage.

public static <
type of the expected value
T
>
Mono<T>

Returns:

A Mono.
fromCompletionStage
(Supplier<? extends CompletionStage<? extends T>>
The Supplier of a CompletionStage that will produce a value (or a null to complete immediately). This allows lazy triggering of CompletionStage-based APIs.
stageSupplier
)

Create a Mono that wraps a lazily-supplied CompletionStage on subscription, emitting the value produced by the CompletionStage.

public static <
type of the value emitted by the publisher
I
>
Mono<I>

Returns:

a wrapped Mono
fromDirect
(Publisher<? extends I>
the Mono-compatible Publisher to wrap
source
)

Convert a Publisher to a Mono without any cardinality check (ie this method doesn't cancel the source past the first element).

public static <
type of the expected value
T
>
Mono<T>

Returns:

A Mono.
fromFuture
(CompletableFuture<? extends T>
CompletableFuture that will produce a value (or a null to complete immediately)
future
)

Create a Mono, producing its value using the provided CompletableFuture and cancelling the future if the Mono gets cancelled.

public static <
type of the expected value
T
>
Mono<T>

Returns:

A Mono.
fromFuture
(CompletableFuture<? extends T>
CompletableFuture that will produce a value (or a null to complete immediately)
future
,
boolean
true to prevent cancellation of the future when the Mono is cancelled, false otherwise (the default)
suppressCancel
)

Create a Mono, producing its value using the provided CompletableFuture and optionally cancelling the future if the Mono gets cancelled (if suppressCancel == false).

public static <
type of the expected value
T
>
Mono<T>

Returns:

A Mono.
fromFuture
(Supplier<? extends CompletableFuture<? extends T>>
The Supplier of a CompletableFuture that will produce a value (or a null to complete immediately). This allows lazy triggering of future-based APIs.
futureSupplier
)

Create a Mono that wraps a lazily-supplied CompletableFuture on subscription, emitting the value produced by the future and cancelling the future if the Mono gets cancelled.

public static <
type of the expected value
T
>
Mono<T>

Returns:

A Mono.
fromFuture
(Supplier<? extends CompletableFuture<? extends T>>
The Supplier of a CompletableFuture that will produce a value (or a null to complete immediately). This allows lazy triggering of future-based APIs.
futureSupplier
,
boolean
true to prevent cancellation of the future when the Mono is cancelled, false otherwise (the default)
suppressCancel
)

Create a Mono that wraps a lazily-supplied CompletableFuture on subscription, emitting the value produced by the future and optionally cancelling the future if the Mono gets cancelled (if suppressCancel == false).

public static <
The generic type of the upstream, which is preserved by this operator
T
>
Mono<T>

Returns:

A Mono.
fromRunnable
(Runnable
Runnable that will be executed before emitting the completion signal
runnable
)

Create a Mono that completes empty once the provided Runnable has been executed.

public static <
type of the expected value
T
>
Mono<T>

Returns:

A Mono.
fromSupplier
(Supplier<? extends T>
Supplier that will produce the value
supplier
)

Create a Mono, producing its value using the provided Supplier.

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

Returns:

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

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

public final Mono<Boolean>

Returns:

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

Emit a single boolean true if this Mono has an element.

public final Mono<T>

Returns:

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

Hides the identity of this Mono instance.

public final Mono<T>

Returns:

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

Ignores onNext signal (dropping it) and only propagates termination events.

public static <
the source type of the ignored data
T
>
Mono<T>

Returns:

a new completable Mono.
ignoreElements
(Publisher<T>
the Publisher to ignore
source
)

Create a new Mono that ignores elements from the source (dropping them), but completes when the source completes.

public static <
the type of the produced item
T
>
Mono<T>

Returns:

a Mono.
just
(T
the only item to onNext
data
)

Create a new Mono that emits the specified item, which is captured at instantiation time.

public static <
the type of the produced item
T
>
Mono<T>

Returns:

a Mono.
justOrEmpty
(Optional<? extends T>
the Optional item to onNext or onComplete if not present
data
)

Create a new Mono that emits the specified item if Optional#isPresent() otherwise only emits onComplete.

public static <
the type of the produced item
T
>
Mono<T>

Returns:

a Mono.
justOrEmpty
(T
the item to onNext or onComplete if null
data
)

Create a new Mono that emits the specified item if non null otherwise only emits onComplete.

public final Mono<T>

Returns:

a new Mono that logs signals
log
()

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

public final Mono<T>

Returns:

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

Observe all Reactive Streams signals and use Logger support to handle trace implementation.

public final Mono<T>

Returns:

a new Mono
log
(String
to be mapped into logger configuration (e.g. org.springframework .reactor). If category ends with "." like "reactor.", a generated operator suffix will complete, e.g. "reactor.Flux.Map".
category
,
Level
the Level to enforce for this tracing Mono (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 flags options and use Logger support to handle trace implementation.

public final Mono<T>

Returns:

a new unaltered Mono
log
(String
to be mapped into logger configuration (e.g. org.springframework .reactor). If category ends with "." like "reactor.", a generated operator suffix will complete, e.g. "reactor.Mono.Map".
category
,
Level
the Level to enforce for this tracing Mono (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 use Logger support to handle trace implementation.

public final Mono<T>

Returns:

a new Mono 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 Mono<T>

Returns:

a new Mono 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.
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
R
>
Mono<R>

Returns:

a new Mono
map
(Function<? super T, ? extends R>
the synchronous transforming Function
mapper
)

Transform the item emitted by this Mono by applying a synchronous function to it.

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

Returns:

a new Mono
mapNotNull
(Function<? super T, ? extends R>
the synchronous transforming Function
mapper
)

Transform the item emitted by this Mono by applying a synchronous function to it, which is allowed to produce a null value.

public final Mono<Signal<T>>

Returns:

a Mono of materialized Signal
materialize
()

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

public final Flux<T>

Returns:

a new Flux as the sequence is not guaranteed to be at most 1
mergeWith
(Publisher<? extends T>
the Publisher to merge with
other
)

Merge emissions of this Mono with the provided Publisher.

public final Mono<T>

Returns:

an instrumented Mono
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 Mono<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
>
Mono<T>

Returns:

a never completing Mono
never
()

Return a Mono that will never signal any data, error or completion signal, essentially running indefinitely.

public final <U> Mono<U>

Returns:

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

Evaluate the emitted value against the given Class type.

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

Returns:

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

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

public final Mono<T>

Returns:

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

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

public final Mono<T>

Returns:

a new Mono 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 Mono<T>

Returns:

a new Mono 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 Mono<T>

Returns:

a Mono that attempts to continue processing on errors.
onErrorContinue
(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> Mono<T>

Returns:

a Mono 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> Mono<T>

Returns:

a Mono 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 Mono<T>

Returns:

a Mono 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 Mono by synchronously applying a function to it if the error matches the given predicate.

public final Mono<T>

Returns:

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

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

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

Returns:

a Mono 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 Mono by synchronously applying a function to it if the error matches the given type.

public final Mono<T>

Returns:

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

Subscribe to a 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
>
Mono<T>

Returns:

a Mono falling back upon source onError
onErrorResume
(Class<E>
the error type to match
type
,
Function<? super E, ? extends Mono<? extends T>>
the function to choose the fallback to an alternative Mono
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 Mono<T>

Returns:

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

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

public final Mono<T>

Returns:

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

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

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

Returns:

a new falling back Mono
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 Mono.

public final Mono<T>

Returns:

a new Mono
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 Mono.

public final Mono<T>

Returns:

a Mono 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 Mono<T>

Returns:

a detachable Mono
onTerminateDetach
()

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

public final Mono<T>

Returns:

a new Mono
or
(Mono<? extends T>
the racing other Mono to compete with for the signal
other
)

Emit the first available signal from this mono or the other mono.

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

Returns:

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

Share a Mono 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:

an asynchronously producing Mono
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:

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 (0 or 1).
repeatFactory
)

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

public final Mono<T>

Returns:

a Mono that resubscribes to this Mono if the previous subscription was empty, as long as the companion Publisher produces an onNext signal
repeatWhenEmpty
(Function<Flux<Long>, ? extends Publisher<?>>
the Function that returns the associated Publisher companion, given a Flux that signals each onComplete as a 0-based incrementing Long.
repeatFactory
)

Repeatedly subscribe to this Mono as long as the current subscription to this Mono completes empty and the companion Publisher produces an onNext signal.

public final Mono<T>

Returns:

a Mono that resubscribes to this Mono if the previous subscription was empty, as long as the companion Publisher produces an onNext signal and the maximum number of repeats isn't exceeded.
repeatWhenEmpty
(int
the maximum number of repeats (infinite if Integer.MAX_VALUE)
maxRepeat
,
Function<Flux<Long>, ? extends Publisher<?>>
the Function that returns the associated Publisher companion, given a Flux that signals each onComplete as a 0-based incrementing Long.
repeatFactory
)

Repeatedly subscribe to this Mono as long as the current subscription to this Mono completes empty and the companion Publisher produces an onNext signal.

public final Mono<T>

Returns:

a Mono that retries on onError
retry
()

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

public final Mono<T>

Returns:

a Mono 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 Mono sequence if it signals any error, for a fixed number of times.

public final Mono<T>

Returns:

a Mono 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 Mono in response to signals emitted by a companion Publisher.

public static <
the type of items emitted by each Publisher
T
>
Mono<Boolean>

Returns:

a Mono that emits a Boolean value that indicates whether the two sequences are the same
sequenceEqual
(Publisher<? extends T>
the first Publisher to compare
source1
,
Publisher<? extends T>
the second Publisher to compare
source2
)

Returns a Mono that emits a Boolean value that indicates whether two Publisher sequences are the same by comparing the items emitted by each Publisher pairwise.

public static <
the type of items emitted by each Publisher
T
>
Mono<Boolean>

Returns:

a Mono that emits a Boolean value that indicates whether the two Publisher two sequences are the same according to the specified function
sequenceEqual
(Publisher<? extends T>
the first Publisher to compare
source1
,
Publisher<? extends T>
the second Publisher to compare
source2
,
BiPredicate<? super T, ? super T>
a function used to compare items emitted by each Publisher
isEqual
)

Returns a Mono that emits a Boolean value that indicates whether two Publisher sequences are the same by comparing the items emitted by each Publisher pairwise based on the results of a specified equality function.

public static <
the type of items emitted by each Publisher
T
>
Mono<Boolean>

Returns:

a Mono that emits a Boolean value that indicates whether the two Publisher two sequences are the same according to the specified function
sequenceEqual
(Publisher<? extends T>
the first Publisher to compare
source1
,
Publisher<? extends T>
the second Publisher to compare
source2
,
BiPredicate<? super T, ? super T>
a function used to compare items emitted by each Publisher
isEqual
,
int
the number of items to prefetch from the first and second source Publisher
prefetch
)

Returns a Mono that emits a Boolean value that indicates whether two Publisher sequences are the same by comparing the items emitted by each Publisher pairwise based on the results of a specified equality function.

public final Mono<T>

Returns:

a new Mono
share
()

Prepare a Mono which shares this Mono result similar to Flux#shareNext().

public final Mono<T>

Returns:

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

Expect exactly one item from this Mono source or signal java.util.NoSuchElementException for an empty source.

public final Mono<Optional<T>>

Returns:

a Mono with an Optional containing the item, an empty optional or an error signal
singleOptional
()

Wrap the item produced by this Mono source into an Optional or emit an empty Optional for an empty source.

public final Disposable

Returns:

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

Subscribe to this Mono 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 Mono that will consume all 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 Mono 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 Mono 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
)

Subscribe Consumer to this Mono 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 Context for the subscription
initialContext
)

Subscribe Consumer to this Mono 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 Mono<T>

Returns:

a Mono 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 <
the reified type of the Subscriber for chaining
E extends Subscriber<? super T>
>
E

Returns:

the passed Subscriber after subscribing it to this Mono
subscribeWith
(E
the Subscriber to subscribe with
subscriber
)

Subscribe the given Subscriber to this Mono and return said Subscriber, allowing subclasses with a richer API to be used fluently.

public final Mono<T>

Returns:

a Mono falling back upon source completing without elements
switchIfEmpty
(Mono<? extends T>
the alternate mono if this mono is empty
alternate
)

Fallback to an alternative Mono if this mono is completed without data

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

public final Mono<T>

Returns:

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

Tag this mono with a key/value pair.

public final Mono<T>

Returns:

a new Mono that will propagate the signals from the source unless no signal is received for duration, in which case it completes.
take
(Duration
the maximum duration to wait for the source Mono to resolve.
duration
)

Give this Mono a chance to resolve within a specified time frame but complete if it doesn't.

public final Mono<T>

Returns:

a new Mono that will propagate the signals from the source unless no signal is received for duration, in which case it completes.
take
(Duration
the maximum duration to wait for the source Mono to resolve.
duration
,
Scheduler
the Scheduler on which to measure the duration.
timer
)

Give this Mono a chance to resolve within a specified time frame but complete if it doesn't.

public final Mono<T>

Returns:

a new Mono that will propagate the signals from the source unless a signal is first received from the companion Publisher, in which case it completes.
takeUntilOther
(Publisher<?>
a companion Publisher that shortcircuits the source with an onComplete signal if it emits before the source emits.
other
)

Give this Mono a chance to resolve before a companion Publisher emits.

public final Mono<T>

Returns:

a new Mono 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 Mono and notify a stateful per-Subscriber SignalListener.

public final Mono<T>

Returns:

a new Mono 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 Mono and notify a stateful per-Subscriber SignalListener.

public final Mono<T>

Returns:

a new Mono 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 Mono and notify a stateful per-Subscriber SignalListener created by the provided SignalListenerFactory.

public final Mono<Void>

Returns:

a Mono ignoring its payload (actively dropping)
then
()

Return a Mono<Void> which only replays complete and error signals from this Mono.

public final <
the element type of the supplied Mono
V
>
Mono<V>

Returns:

a new Mono that emits from the supplied Mono
then
(Mono<V>
a Mono to emit from after termination
other
)

Let this Mono complete then play another 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 Mono's termination
other
)

Return a Mono<Void> that waits for this Mono 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 Mono completes.
thenMany
(Publisher<V>
a Publisher to emit from after termination
other
)

Let this Mono complete successfully then play another Publisher.

public final <
the element type of the supplied value
V
>
Mono<V>

Returns:

a new Mono that emits the supplied value
thenReturn
(V
a value to emit after successful termination
value
)

Let this Mono complete successfully, then emit the provided value.

public final Mono<Timed<T>>

Returns:

a timed Mono
timed
()

Times this Mono Subscriber#onNext(Object) event, 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 Mono<Timed<T>>

Returns:

a timed Mono
timed
(Scheduler clock)

Times this Mono Subscriber#onNext(Object) event, 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 Mono<T>

Returns:

a Mono that can time out
timeout
(Duration
the timeout before the onNext signal from this Mono
timeout
)

Propagate a TimeoutException in case no item arrives within the given Duration.

public final Mono<T>

Returns:

a Mono that will fallback to a different Mono in case of timeout
timeout
(Duration
the timeout before the onNext signal from this Mono
timeout
,
Mono<? extends T>
the fallback Mono to subscribe to when a timeout occurs
fallback
)

Switch to a fallback Mono in case no item arrives within the given Duration.

public final Mono<T>

Returns:

an expirable Mono
timeout
(Duration
the timeout before the onNext signal from this Mono
timeout
,
Scheduler
a time-capable Scheduler instance to run the delay on
timer
)

Signal a TimeoutException error in case an item doesn't arrive before the given period, as measured on the provided Scheduler.

public final Mono<T>

Returns:

an expirable Mono with a fallback Mono
timeout
(Duration
the timeout before the onNext signal from this Mono
timeout
,
Mono<? extends T>
the fallback Mono to subscribe when a timeout occurs
fallback
,
Scheduler
a time-capable Scheduler instance to run on
timer
)

Switch to a fallback Mono in case an item doesn't arrive before the given period, as measured on the provided Scheduler.

public final <
the element type of the timeout Publisher
U
>
Mono<T>

Returns:

an expirable Mono if the item does not come before a Publisher signals
timeout
(Publisher<U>
the timeout Publisher that must not emit before the first signal from this Mono
firstTimeout
)

Signal a TimeoutException in case the item from this Mono has not been emitted before the given Publisher emits.

public final <
the element type of the timeout Publisher
U
>
Mono<T>

Returns:

an expirable Mono with a fallback Mono if the item doesn't come before a Publisher signals
timeout
(Publisher<U>
the timeout Publisher that must not emit before the first signal from this Mono
firstTimeout
,
Mono<? extends T>
the fallback Publisher to subscribe when a timeout occurs
fallback
)

Switch to a fallback Publisher in case the item from this Mono has not been emitted before the given Publisher emits.

public final Mono<Tuple2<Long, T>>

Returns:

a timestamped Mono
timestamp
()

If this Mono is valued, 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).

public final Mono<Tuple2<Long, T>>

Returns:

a timestamped Mono
timestamp
(Scheduler
a Scheduler instance to read time from
scheduler
)

If this Mono is valued, 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).

public final CompletableFuture<T>
toFuture()

Transform this Mono into a CompletableFuture completing on onNext or onComplete and failing on onError.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public final <
the item type in the returned Mono
V
>
Mono<V>

Returns:

a new Mono
transform
(Function<? super Mono<T>, ? extends Publisher<V>>
the Function to immediately map this Mono into a target Mono instance.
transformer
)

Transform this Mono in order to generate a target Mono.

public final <
the item type in the returned Publisher
V
>
Mono<V>

Returns:

a new Mono
transformDeferred
(Function<? super Mono<T>, ? extends Publisher<V>>
the Function to lazily map this Mono into a target Mono instance upon subscription.
transformer
)

Defer the given transformation to this Mono in order to generate a target Mono type.

public final <
the item type in the returned Publisher
V
>
Mono<V>

Returns:

a new Mono
transformDeferredContextual
(BiFunction<? super Mono<T>, ? super ContextView, ? extends Publisher<V>>
the BiFunction to lazily map this Mono into a target Mono instance upon subscription, with access to ContextView
transformer
)

Defer the given transformation to this Mono in order to generate a target Mono type.

public static <
emitted type
T
,
resource type
D
>
Mono<T>

Returns:

new Mono
using
(Callable<? extends D>
a Callable that is called on subscribe to create the resource
resourceSupplier
,
Function<? super D, ? extends Mono<? extends T>>
a Mono factory to create the Mono depending on the created resource
sourceSupplier
,
Consumer<? super D>
invoked on completion to clean-up the resource
resourceCleanup
,
boolean
set to true to clean before any signal (including onNext) is passed downstream
eager
)

Uses a resource, generated by a supplier for each individual Subscriber, while streaming the value from a Mono 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
>
Mono<T>

Returns:

new Mono
using
(Callable<? extends D>
a Callable that is called on subscribe to create the resource
resourceSupplier
,
Function<? super D, ? extends Mono<? extends T>>
a Mono factory to create the Mono depending on the created resource
sourceSupplier
,
Consumer<? super D>
invoked on completion to clean-up the resource
resourceCleanup
)

Uses a resource, generated by a supplier for each individual Subscriber, while streaming the value from a Mono 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
>
Mono<T>

Returns:

a new Mono built around a "transactional" resource, with deferred emission until the asynchronous cleanup sequence completes
usingWhen
(Publisher<D>
a Publisher that "generates" the resource, subscribed for each subscription to the main sequence
resourceSupplier
,
Function<? super D, ? extends Mono<? extends T>>
a factory to derive a Mono 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, to derive a Mono.

public static <
the type of elements emitted by the resource closure, and thus the main sequence
T
,
the type of the resource object
D
>
Mono<T>

Returns:

a new Mono 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 Mono<? extends T>>
a factory to derive a Mono 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, to derive a Mono.Note that all steps of the operator chain that would need the resource to be in an open stable state need to be described inside the resourceClosure Function.

public static Mono<Void>

Returns:

a Mono.
when
(Publisher<?>...
The sources to use.
sources
)

Aggregate given publishers into a new Mono that will be fulfilled when all of the given sources have completed.

public static Mono<Void>

Returns:

a Mono.
when
(final Iterable<? extends Publisher<?>>
The sources to use.
sources
)

Aggregate given publishers into a new Mono that will be fulfilled when all of the given Publishers have completed.

public static Mono<Void>

Returns:

a Mono.
whenDelayError
(final Iterable<? extends Publisher<?>>
The sources to use.
sources
)

Aggregate given publishers into a new Mono that will be fulfilled when all of the given sources have completed.

public static Mono<Void>

Returns:

a Mono.
whenDelayError
(Publisher<?>...
The sources to use.
sources
)

Merge given publishers into a new Mono that will be fulfilled when all of the given sources have completed.

pack-priv static <
input upstream type
T
>
Mono<T>

Returns:

a wrapped Mono
wrap
(Publisher<T>
the Publisher to wrap
source
,
boolean
true to wrap publishers without assumption about their cardinality (first Subscriber#onNext(Object) will cancel the source), false to behave like fromDirect(Publisher).
enforceMonoContract
)

Unchecked wrap of Publisher as Mono, supporting Fuseable sources.

public static <
type of the value from p1
T1
,
type of the value from p2
T2
>
Mono<Tuple2<T1, T2>>

Returns:

a Mono.
zip
(Mono<? extends T1>
The first upstream Publisher to subscribe to.
p1
,
Mono<? extends T2>
The second upstream Publisher to subscribe to.
p2
)

Merge given monos into a new Mono that will be fulfilled when all of the given Monos have produced an item, aggregating their values into a Tuple2.

public static <
type of the value from p1
T1
,
type of the value from p2
T2
,
output value
O
>
Mono<O>

Returns:

a Mono.
zip
(Mono<? extends T1>
The first upstream Publisher to subscribe to.
p1
,
Mono<? extends T2>
The second upstream Publisher to subscribe to.
p2
,
BiFunction<? super T1, ? super T2, ? extends O>
a BiFunction combinator function when both sources complete
combinator
)

Merge given monos into a new Mono that will be fulfilled when all of the given Monos have produced an item, aggregating their values as defined by the combinator function.

public static <
type of the value from p1
T1
,
type of the value from p2
T2
,
type of the value from p3
T3
>
Mono<Tuple3<T1, T2, T3>>

Returns:

a Mono.
zip
(Mono<? extends T1>
The first upstream Publisher to subscribe to.
p1
,
Mono<? extends T2>
The second upstream Publisher to subscribe to.
p2
,
Mono<? extends T3>
The third upstream Publisher to subscribe to.
p3
)

Merge given monos into a new Mono that will be fulfilled when all of the given Monos have produced an item, aggregating their values into a Tuple3.

public static <
type of the value from p1
T1
,
type of the value from p2
T2
,
type of the value from p3
T3
,
type of the value from p4
T4
>
Mono<Tuple4<T1, T2, T3, T4>>

Returns:

a Mono.
zip
(Mono<? extends T1>
The first upstream Publisher to subscribe to.
p1
,
Mono<? extends T2>
The second upstream Publisher to subscribe to.
p2
,
Mono<? extends T3>
The third upstream Publisher to subscribe to.
p3
,
Mono<? extends T4>
The fourth upstream Publisher to subscribe to.
p4
)

Merge given monos into a new Mono that will be fulfilled when all of the given Monos have produced an item, aggregating their values into a Tuple4.

public static <
type of the value from p1
T1
,
type of the value from p2
T2
,
type of the value from p3
T3
,
type of the value from p4
T4
,
type of the value from p5
T5
>
Mono<Tuple5<T1, T2, T3, T4, T5>>

Returns:

a Mono.
zip
(Mono<? extends T1>
The first upstream Publisher to subscribe to.
p1
,
Mono<? extends T2>
The second upstream Publisher to subscribe to.
p2
,
Mono<? extends T3>
The third upstream Publisher to subscribe to.
p3
,
Mono<? extends T4>
The fourth upstream Publisher to subscribe to.
p4
,
Mono<? extends T5>
The fifth upstream Publisher to subscribe to.
p5
)

Merge given monos into a new Mono that will be fulfilled when all of the given Monos have produced an item, aggregating their values into a Tuple5.

public static <
type of the value from p1
T1
,
type of the value from p2
T2
,
type of the value from p3
T3
,
type of the value from p4
T4
,
type of the value from p5
T5
,
type of the value from p6
T6
>
Mono<Tuple6<T1, T2, T3, T4, T5, T6>>

Returns:

a Mono.
zip
(Mono<? extends T1>
The first upstream Publisher to subscribe to.
p1
,
Mono<? extends T2>
The second upstream Publisher to subscribe to.
p2
,
Mono<? extends T3>
The third upstream Publisher to subscribe to.
p3
,
Mono<? extends T4>
The fourth upstream Publisher to subscribe to.
p4
,
Mono<? extends T5>
The fifth upstream Publisher to subscribe to.
p5
,
Mono<? extends T6>
The sixth upstream Publisher to subscribe to.
p6
)

Merge given monos into a new Mono that will be fulfilled when all of the given Monos have produced an item, aggregating their values into a Tuple6.

public static <
type of the value from p1
T1
,
type of the value from p2
T2
,
type of the value from p3
T3
,
type of the value from p4
T4
,
type of the value from p5
T5
,
type of the value from p6
T6
,
type of the value from p7
T7
>
Mono<Tuple7<T1, T2, T3, T4, T5, T6, T7>>

Returns:

a Mono.
zip
(Mono<? extends T1>
The first upstream Publisher to subscribe to.
p1
,
Mono<? extends T2>
The second upstream Publisher to subscribe to.
p2
,
Mono<? extends T3>
The third upstream Publisher to subscribe to.
p3
,
Mono<? extends T4>
The fourth upstream Publisher to subscribe to.
p4
,
Mono<? extends T5>
The fifth upstream Publisher to subscribe to.
p5
,
Mono<? extends T6>
The sixth upstream Publisher to subscribe to.
p6
,
Mono<? extends T7>
The seventh upstream Publisher to subscribe to.
p7
)

Merge given monos into a new Mono that will be fulfilled when all of the given Monos have produced an item, aggregating their values into a Tuple7.

public static <
type of the value from p1
T1
,
type of the value from p2
T2
,
type of the value from p3
T3
,
type of the value from p4
T4
,
type of the value from p5
T5
,
type of the value from p6
T6
,
type of the value from p7
T7
,
type of the value from p8
T8
>
Mono<Tuple8<T1, T2, T3, T4, T5, T6, T7, T8>>

Returns:

a Mono.
zip
(Mono<? extends T1>
The first upstream Publisher to subscribe to.
p1
,
Mono<? extends T2>
The second upstream Publisher to subscribe to.
p2
,
Mono<? extends T3>
The third upstream Publisher to subscribe to.
p3
,
Mono<? extends T4>
The fourth upstream Publisher to subscribe to.
p4
,
Mono<? extends T5>
The fifth upstream Publisher to subscribe to.
p5
,
Mono<? extends T6>
The sixth upstream Publisher to subscribe to.
p6
,
Mono<? extends T7>
The seventh upstream Publisher to subscribe to.
p7
,
Mono<? extends T8>
The eight upstream Publisher to subscribe to.
p8
)

Merge given monos into a new Mono that will be fulfilled when all of the given Monos have produced an item, aggregating their values into a Tuple8.

public static <
the combined result
R
>
Mono<R>

Returns:

a Mono.
zip
(final Iterable<? extends Mono<?>>
The monos to use.
monos
,
Function<? super Object[], ? extends R>
the function to transform the combined array into an arbitrary object.
combinator
)

Aggregate given monos into a new Mono that will be fulfilled when all of the given Monos have produced an item, aggregating their values according to the provided combinator function.

public static <
the combined result
R
>
Mono<R>

Returns:

a Mono.
zip
(Function<? super Object[], ? extends R>
the function to transform the combined array into an arbitrary object.
combinator
,
Mono<?>...
The monos to use.
monos
)

Aggregate given monos into a new Mono that will be fulfilled when all of the given Monos have produced an item, aggregating their values according to the provided combinator function.

public static <
type of the value from p1
T1
,
type of the value from p2
T2
>
Mono<Tuple2<T1, T2>>

Returns:

a Mono.
zipDelayError
(Mono<? extends T1>
The first upstream Publisher to subscribe to.
p1
,
Mono<? extends T2>
The second upstream Publisher to subscribe to.
p2
)

Merge given monos into a new Mono that will be fulfilled when all of the given Monos have produced an item, aggregating their values into a Tuple2 and delaying errors.

public static <
type of the value from p1
T1
,
type of the value from p2
T2
,
type of the value from p3
T3
>
Mono<Tuple3<T1, T2, T3>>

Returns:

a Mono.
zipDelayError
(Mono<? extends T1>
The first upstream Publisher to subscribe to.
p1
,
Mono<? extends T2>
The second upstream Publisher to subscribe to.
p2
,
Mono<? extends T3>
The third upstream Publisher to subscribe to.
p3
)

Merge given monos into a new Mono that will be fulfilled when all of the given Mono Monos have produced an item, aggregating their values into a Tuple3 and delaying errors.

public static <
type of the value from p1
T1
,
type of the value from p2
T2
,
type of the value from p3
T3
,
type of the value from p4
T4
>
Mono<Tuple4<T1, T2, T3, T4>>

Returns:

a Mono.
zipDelayError
(Mono<? extends T1>
The first upstream Publisher to subscribe to.
p1
,
Mono<? extends T2>
The second upstream Publisher to subscribe to.
p2
,
Mono<? extends T3>
The third upstream Publisher to subscribe to.
p3
,
Mono<? extends T4>
The fourth upstream Publisher to subscribe to.
p4
)

Merge given monos into a new Mono that will be fulfilled when all of the given Monos have produced an item, aggregating their values into a Tuple4 and delaying errors.

public static <
type of the value from p1
T1
,
type of the value from p2
T2
,
type of the value from p3
T3
,
type of the value from p4
T4
,
type of the value from p5
T5
>
Mono<Tuple5<T1, T2, T3, T4, T5>>

Returns:

a Mono.
zipDelayError
(Mono<? extends T1>
The first upstream Publisher to subscribe to.
p1
,
Mono<? extends T2>
The second upstream Publisher to subscribe to.
p2
,
Mono<? extends T3>
The third upstream Publisher to subscribe to.
p3
,
Mono<? extends T4>
The fourth upstream Publisher to subscribe to.
p4
,
Mono<? extends T5>
The fifth upstream Publisher to subscribe to.
p5
)

Merge given monos into a new Mono that will be fulfilled when all of the given Monos have produced an item, aggregating their values into a Tuple5 and delaying errors.

public static <
type of the value from p1
T1
,
type of the value from p2
T2
,
type of the value from p3
T3
,
type of the value from p4
T4
,
type of the value from p5
T5
,
type of the value from p6
T6
>
Mono<Tuple6<T1, T2, T3, T4, T5, T6>>

Returns:

a Mono.
zipDelayError
(Mono<? extends T1>
The first upstream Publisher to subscribe to.
p1
,
Mono<? extends T2>
The second upstream Publisher to subscribe to.
p2
,
Mono<? extends T3>
The third upstream Publisher to subscribe to.
p3
,
Mono<? extends T4>
The fourth upstream Publisher to subscribe to.
p4
,
Mono<? extends T5>
The fifth upstream Publisher to subscribe to.
p5
,
Mono<? extends T6>
The sixth upstream Publisher to subscribe to.
p6
)

Merge given monos into a new Mono that will be fulfilled when all of the given Monos have produced an item, aggregating their values into a Tuple6 and delaying errors.

public static <
type of the value from p1
T1
,
type of the value from p2
T2
,
type of the value from p3
T3
,
type of the value from p4
T4
,
type of the value from p5
T5
,
type of the value from p6
T6
,
type of the value from p7
T7
>
Mono<Tuple7<T1, T2, T3, T4, T5, T6, T7>>

Returns:

a Mono.
zipDelayError
(Mono<? extends T1>
The first upstream Publisher to subscribe to.
p1
,
Mono<? extends T2>
The second upstream Publisher to subscribe to.
p2
,
Mono<? extends T3>
The third upstream Publisher to subscribe to.
p3
,
Mono<? extends T4>
The fourth upstream Publisher to subscribe to.
p4
,
Mono<? extends T5>
The fifth upstream Publisher to subscribe to.
p5
,
Mono<? extends T6>
The sixth upstream Publisher to subscribe to.
p6
,
Mono<? extends T7>
The seventh upstream Publisher to subscribe to.
p7
)

Merge given monos into a new Mono that will be fulfilled when all of the given Monos have produced an item, aggregating their values into a Tuple7 and delaying errors.

public static <
type of the value from p1
T1
,
type of the value from p2
T2
,
type of the value from p3
T3
,
type of the value from p4
T4
,
type of the value from p5
T5
,
type of the value from p6
T6
,
type of the value from p7
T7
,
type of the value from p8
T8
>
Mono<Tuple8<T1, T2, T3, T4, T5, T6, T7, T8>>

Returns:

a Mono.
zipDelayError
(Mono<? extends T1>
The first upstream Publisher to subscribe to.
p1
,
Mono<? extends T2>
The second upstream Publisher to subscribe to.
p2
,
Mono<? extends T3>
The third upstream Publisher to subscribe to.
p3
,
Mono<? extends T4>
The fourth upstream Publisher to subscribe to.
p4
,
Mono<? extends T5>
The fifth upstream Publisher to subscribe to.
p5
,
Mono<? extends T6>
The sixth upstream Publisher to subscribe to.
p6
,
Mono<? extends T7>
The seventh upstream Publisher to subscribe to.
p7
,
Mono<? extends T8>
The eight upstream Publisher to subscribe to.
p8
)

Merge given monos into a new Mono that will be fulfilled when all of the given Monos have produced an item, aggregating their values into a Tuple8 and delaying errors.

public static <
the combined result
R
>
Mono<R>

Returns:

a Mono.
zipDelayError
(final Iterable<? extends Mono<?>>
The monos to use.
monos
,
Function<? super Object[], ? extends R>
the function to transform the combined array into an arbitrary object.
combinator
)

Aggregate given monos into a new Mono that will be fulfilled when all of the given Monos have produced an item.

public static <
the combined result
R
>
Mono<R>

Returns:

a combined Mono.
zipDelayError
(Function<? super Object[], ? extends R>
the function to transform the combined array into an arbitrary object.
combinator
,
Mono<?>...
The monos to use.
monos
)

Merge given monos into a new Mono that will be fulfilled when all of the given Monos have produced an item, aggregating their values according to the provided combinator function and delaying errors.

public final <
the element type of the other Mono instance
T2
>
Mono<Tuple2<T, T2>>

Returns:

a new combined Mono
zipWhen
(Function<T, Mono<? extends T2>>
the Function to generate a Mono to combine with
rightGenerator
)

Wait for the result from this mono, use it to create a second mono via the provided rightGenerator function and combine both results into a Tuple2.

public final <
the element type of the other Mono instance
T2
,
the element type of the combination
O
>
Mono<O>

Returns:

a new combined Mono
zipWhen
(Function<T, Mono<? extends T2>>
the Function to generate a Mono to combine with
rightGenerator
,
BiFunction<T, T2, O>
a BiFunction combinator function when both sources complete
combinator
)

Wait for the result from this mono, use it to create a second mono via the provided rightGenerator function and combine both results into an arbitrary O object, as defined by the provided combinator function.

public final <
the element type of the other Mono instance
T2
>
Mono<Tuple2<T, T2>>

Returns:

a new combined Mono
zipWith
(Mono<? extends T2>
the Mono to combine with
other
)

Combine the result from this mono and another into a Tuple2.

public final <
the element type of the other Mono instance
T2
,
the element type of the combination
O
>
Mono<O>

Returns:

a new combined Mono
zipWith
(Mono<? extends T2>
the Mono to combine with
other
,
BiFunction<? super T, ? super T2, ? extends O>
a BiFunction combinator function when both sources complete
combinator
)

Combine the result from this mono and another into an arbitrary O object, as defined by the provided combinator function.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait