An alias for Mono.and
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.
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.
the element type of the other Mono instance
the element type of the combination
the scala.Function1 to generate a Mono
to combine with
a scala.Function2 combinator function when both sources complete
a new combined Mono
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 scala.Tuple2.
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 scala.Tuple2.
the element type of the other Mono instance
the scala.Function1 to generate a Mono
to combine with
a new combined Mono
Combine the result from this mono and another into an arbitrary O
object,
as defined by the provided combinator
function.
Combine the result from this mono and another into an arbitrary O
object,
as defined by the provided combinator
function.
the element type of the other Mono instance
the element type of the combination
the Mono to combine with
a scala.Function2 combinator function when both sources complete
a new combined Mono
Combine the result from this mono and another into a scala.Tuple2.
Transform this Mono into a target type.
Transform this Mono into a target type.
mono.as(Flux::from).subscribe()
the returned instance type
the { @link Function} applying this { @link Mono}
the transformed { @link Mono} to instance P
Mono.compose for a bounded conversion to org.reactivestreams.Publisher
Intercepts the onSubscribe call and makes sure calls to Subscription methods only happen after the child Subscriber has returned from its onSubscribe method.
Intercepts the onSubscribe call and makes sure calls to Subscription methods only happen after the child Subscriber has returned from its onSubscribe method.
This helps with child Subscribers that don't expect a recursive call from onSubscribe into their onNext because, for example, they request immediately from their onSubscribe but don't finish their preparation before that and onNext runs into a half-prepared state. This can happen with non Reactor based Subscribers.
non reentrant onSubscribe Mono
Block until a next signal is received, will return null if onComplete, T if onNext, throw a
Exceptions.DownstreamException
if checked error or origin RuntimeException if unchecked.
Block until a next signal is received, will return null if onComplete, T if onNext, throw a
Exceptions.DownstreamException
if checked error or origin RuntimeException if unchecked.
If the default timeout 30 seconds
has elapsed,a RuntimeException will be thrown.
Note that each block() will subscribe a new single (MonoSink) subscriber, in other words, the result might miss signal from hot publishers.
maximum time period to wait for before raising a RuntimeException
T the result
Block until a next signal is received, will return null if onComplete, T if onNext, throw a
Exceptions.DownstreamException
if checked error or origin RuntimeException if unchecked.
Block until a next signal is received, will return null if onComplete, T if onNext, throw a
Exceptions.DownstreamException
if checked error or origin RuntimeException if unchecked.
T the result
Turn this Mono into a hot source and cache last emitted signals for further Subscriber.
Prepare this Mono so that subscribers will cancel from it on a specified reactor.core.scheduler.Scheduler.
Cast the current Mono produced type into a target produced type.
Defer the given transformation to this Mono in order to generate a target Mono type.
Defer the given transformation to this Mono in order to generate a target Mono type. A transformation will occur for each org.reactivestreams.Subscriber.
flux.compose(Mono::from).subscribe()
the item type in the returned org.reactivestreams.Publisher
the function to immediately map this Mono into a target Mono instance.
a new Mono
Mono.as for a loose conversion to an arbitrary type
Concatenate emissions of this Mono with the provided Publisher (no interleave).
Provide a default unique value if this mono is completed without any data
Provide a default unique value if this mono is completed without any data
the alternate value if this sequence is empty
a new Mono
Delay the subscription to this Mono until another Publisher signals a value or completes.
Delay the subscription to this Mono until another Publisher signals a value or completes.
the other source type
a Publisher to signal by next or complete this Mono.subscribe
a delayed Mono
Delay the subscription to this Mono source until the given Duration elapses.
Delay the subscription to this Mono source until the given Duration elapses.
Delay the subscription to this Mono source until the given period elapses.
Delay the subscription to this Mono source until the given period elapses.
A "phantom-operator" working only if this Mono is a emits onNext, onError or onComplete reactor.core.publisher.Signal.
A "phantom-operator" working only if this Mono is a emits onNext, onError or onComplete reactor.core.publisher.Signal. The relative org.reactivestreams.Subscriber callback will be invoked, error reactor.core.publisher.Signal will trigger onError and complete reactor.core.publisher.Signal will trigger onComplete.
the dematerialized type
a dematerialized Mono
Triggered after the Mono terminates, either by completing downstream successfully or with an error.
Triggered after the Mono terminates, either by completing downstream successfully or with an error. The arguments will be null depending on success, success with data and error:
the callback to call after org.reactivestreams.Subscriber.onNext, org.reactivestreams.Subscriber.onComplete without preceding org.reactivestreams.Subscriber.onNext or org.reactivestreams.Subscriber.onError
a new Mono
Triggered when the Mono is cancelled.
Triggered when the Mono completes with an error matching the given exception.
Triggered when the Mono completes with an error matching the given exception type.
Triggered when the Mono completes with an error.
Attach a Long consumer
to this Mono that will observe any request to this Mono.
Triggered when the Mono is subscribed.
Triggered when the Mono completes successfully.
Triggered when the Mono completes successfully.
Triggered when the Mono terminates, either by completing successfully or with an error.
Triggered when the Mono terminates, either by completing successfully or with an error.
the callback to call Subscriber.onNext, Subscriber.onComplete without preceding Subscriber.onNext or Subscriber.onError
a new Mono
Map this Mono sequence into scala.Tuple2 of T1 Long timemillis and T2
T
associated data.
Map this Mono sequence into scala.Tuple2 of T1 Long timemillis and T2
T
associated data. The timemillis corresponds to the elapsed time between the subscribe and the first
next signal.
the Scheduler to read time from
a transforming Mono that emits a tuple of time elapsed in milliseconds and matching data
Map this Mono sequence into scala.Tuple2 of T1 Long timemillis and T2
T
associated data.
Test the result if any of this Mono and replay it if predicate returns true.
If this Mono is valued, test the value asynchronously using a generated Publisher[Boolean] test.
If this Mono is valued, test the value asynchronously using a generated
Publisher[Boolean] test. The value from the Mono is replayed if the
first item emitted by the test is true
. It is dropped if the test is
either empty or its first emitted value is false.
Note that only the first value of the test publisher is considered, and unless it is a Mono, test will be cancelled after receiving that first value.
the function generating a Publisher of Boolean to filter the Mono with
a filtered Mono
Transform the item emitted by this Mono into Iterable, , then forward its elements into the returned Flux.
Transform the item emitted by this Mono into Iterable, , then forward its elements into the returned Flux. The prefetch argument allows to give an arbitrary prefetch size to the inner Iterable.
the merged output sequence type
the Function1 to transform input item into a sequence Iterable
a merged Flux
Transform the signals emitted by this Mono into a Publisher, then forward its emissions into the returned Flux.
Transform the signals emitted by this Mono into a Publisher, then forward its emissions into the returned Flux.
the type of the produced inner sequence
the Function1 to call on next data and returning a sequence to merge
theFunction1 to call on error signal and returning a sequence to merge
the Function1 to call on complete signal and returning a sequence to merge
a new Flux as the sequence is not guaranteed to be single at most
Transform the item emitted by this Mono into a Publisher, then forward its emissions into the returned Flux.
Handle the items emitted by this Mono by calling a biconsumer with the output sink for each onNext.
Emit a single boolean true if this Mono has an element.
Hides the identity of this Mono instance.
Ignores onNext signal (dropping it) and only reacts on termination.
Ignores onNext signal (dropping it) and only reacts on termination.
a new completable Mono.
Transform the incoming onNext, onError and onComplete signals into Signal.
Transform the incoming onNext, onError and onComplete signals into Signal.
Since the error is materialized as a Signal
, the propagation will be stopped and onComplete will be
emitted. Complete signal will first emit a Signal.complete()
and then effectively complete the flux.
a Mono of materialized Signal
Merge emissions of this Mono with the provided Publisher.
Evaluate the accepted value against the given Class type.
Transform the error emitted by this Mono by applying a function if the error matches the given predicate, otherwise let the error flow.
Transform the error emitted by this Mono by applying a function if the error matches the given type, otherwise let the error flow.
Transform the error emitted by this Mono by applying a function.
Subscribe to a returned fallback publisher when an error matching the given predicate occurs.
Subscribe to a returned fallback publisher when an error matching the given type occurs.
Subscribe to a returned fallback publisher when any error occurs.
Subscribe to a returned fallback publisher when any error occurs.
the function to map an alternative { @link Mono}
an alternating Mono on source onError
Simply emit a captured fallback value when an error matching the given predicate is observed on this Mono.
Simply emit a captured fallback value when an error of the specified type is observed on this Mono.
Simply emit a captured fallback value when any error is observed on this Mono.
Detaches the both the child Subscriber and the Subscription on termination or cancellation.
Detaches the both the child Subscriber and the Subscription on termination or cancellation.
This should help with odd retention scenarios when running with non-reactor Subscriber.
a detachable Mono
Emit the any of the result from this mono or from the given mono
Emit the any of the result from this mono or from the given mono
the racing other { @link Mono} to compete with for the result
a new Mono
Shares 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.
Run onNext, onComplete and onError on a supplied Scheduler
Run onNext, onComplete and onError on a supplied Scheduler
Typically used for fast publisher, slow consumer(s) scenarios.
mono.publishOn(Schedulers.single()).subscribe()
a checked { @link reactor.core.scheduler.Scheduler.Worker} factory
an asynchronously producing Mono
Repeatedly subscribe to the source if the predicate returns true after completion of the previous subscription.
Repeatedly subscribe to the source if the predicate returns true after completion of the previous subscription. A specified maximum of repeat will limit the number of re-subscribe.
the number of times to re-subscribe on complete
the boolean to evaluate on onComplete
an eventually repeated Flux on onComplete up to number of repeat specified OR matching predicate
Repeatedly subscribe to the source if the predicate returns true after completion of the previous subscription.
Repeatedly subscribe to the source if the predicate returns true after completion of the previous subscription.
the number of times to re-subscribe on onComplete
an eventually repeated Flux on onComplete up to number of repeat specified
Repeatedly subscribe to the source if the predicate returns true after completion of the previous subscription.
Repeatedly subscribe to the source if the predicate returns true after completion of the previous subscription.
the boolean to evaluate on onComplete.
an eventually repeated Flux on onComplete
Repeatedly subscribe to the source completion of the previous subscription.
Repeatedly subscribe to the source completion of the previous subscription.
an indefinitively repeated Flux on onComplete
Repeatedly subscribe to this Mono when a companion sequence signals a number of emitted elements in response to the flux completion signal.
Repeatedly subscribe to this Mono when a companion sequence signals a number of emitted elements in response to the flux completion signal.
If the companion sequence signals when this Mono is active, the repeat attempt is suppressed and any terminal signal will terminate this Flux with the same signal immediately.
Repeatedly subscribe to this Mono until there is an onNext signal when a companion sequence signals a number of emitted elements.
Repeatedly subscribe to this Mono until there is an onNext signal when a companion sequence signals a number of emitted elements.
If the companion sequence signals when this Mono is active, the repeat attempt is suppressed and any terminal signal will terminate this Mono with the same signal immediately.
Emits an IllegalStateException if the max repeat is exceeded and different from Int.MaxValue.
the maximum repeat number of time (infinite if Int.MaxValue)
the Function1 providing a Flux signalling the current repeat index from 0 on onComplete and returning a { @link Publisher} companion.
an eventually repeated Mono on onComplete when the companion Publisher produces an onNext signal
Repeatedly subscribe to this Mono until there is an onNext signal when a companion sequence signals a number of emitted elements.
Repeatedly subscribe to this Mono until there is an onNext signal when a companion sequence signals a number of emitted elements.
If the companion sequence signals when this Mono is active, the repeat attempt is suppressed and any terminal signal will terminate this Mono with the same signal immediately.
Re-subscribes to this Mono sequence up to the specified number of retries if it signals any
error and the given Predicate
matches otherwise push the error downstream.
Re-subscribes to this Mono sequence up to the specified number of retries if it signals any
error and the given Predicate
matches otherwise push the error downstream.
the number of times to tolerate an error
the predicate to evaluate if retry should occur based on a given error signal
a re-subscribing Mono on onError up to the specified number of retries and if the predicate matches.
Re-subscribes to this Mono sequence if it signals any error
and the given Predicate
matches otherwise push the error downstream.
Re-subscribes to this Mono sequence if it signals any error either indefinitely or a fixed number of times.
Re-subscribes to this Mono sequence if it signals any error either indefinitely.
Retries this Mono when a companion sequence signals an item in response to this Mono error signal
Subscribe Consumer to this Mono that will consume all the sequence.
Subscribe Consumer to this Mono that will consume all the sequence.
For a passive version that observe and forward incoming data see Mono.doOnSuccess and Mono.doOnError.
the consumer to invoke on each value
the consumer to invoke on error signal
the consumer to invoke on complete signal
the consumer to invoke on subscribe signal, to be used for the initial request, or null for max request
a new Disposable to dispose the Subscription
Subscribe consumer
to this Mono that will consume all the
sequence.
Subscribe consumer
to this Mono that will consume all the
sequence.
For a passive version that observe and forward incoming data see Mono.doOnSuccess and Mono.doOnError.
the consumer to invoke on each value
the consumer to invoke on error signal
the consumer to invoke on complete signal
a new Disposable to dispose the Subscription
Subscribe Consumer to this Mono that will consume all the sequence.
Subscribe Consumer to this Mono that will consume all the sequence.
For a passive version that observe and forward incoming data see Mono.doOnSuccess and Mono.doOnError.
the consumer to invoke on each next signal
the consumer to invoke on error signal
a new Runnable to dispose the org.reactivestreams.Subscription
Subscribe a Consumer to this Mono that will consume all the sequence.
Subscribe a Consumer to this Mono that will consume all the sequence.
For a passive version that observe and forward incoming data see Mono.doOnSuccess and Mono.doOnError.
the consumer to invoke on each value
a new Runnable to dispose the Subscription
Start the chain and request unbounded demand.
Start the chain and request unbounded demand.
a Runnable task to execute to dispose and cancel the underlying Subscription
Run the requests to this Publisher Mono on a given worker assigned by the supplied Scheduler.
Subscribe the Mono with the givne Subscriber and return it.
Subscribe the Mono with the givne Subscriber and return it.
the Subscriber to subscribe
the passed { @link Subscriber} after subscribing it to this { @link Mono}
Provide an alternative Mono if this mono is completed without data
Ignore element from this Mono and transform its completion signal into the
emission and completion signal of a provided Mono[V]
.
Ignore element from this Mono and transform its completion signal into the
emission and completion signal of a provided Mono[V]
. Error signal is
replayed in the resulting Mono[V]
.
Convert the value of Mono to another Mono possibly with another value type.
the result type bound
the function to dynamically bind a new Mono
a new Mono containing the merged values
in 3.1.0.M1 this method will be renamed flatMap
. However, until
then the behavior of Mono.flatMap remains the current one, so it is
not yet possible to anticipate this migration.
Return a Mono[Unit]
which only replays complete and error signals
from this Mono.
Return a Mono[Unit]
that waits for this Mono to complete then
for a supplied Publisher[Unit] to also complete.
Return a Mono[Unit]
that waits for this Mono to complete then
for a supplied Publisher[Unit] to also complete. The
second completion signal is replayed, or any error signal that occurs instead.
a Publisher to wait for after this Mono's termination
a new Mono completing when both publishers have completed in sequence
Ignore element from this mono and transform the completion signal into a
Flux[V]
that will emit elements from the provided Publisher.
Ignore element from this mono and transform the completion signal into a
Flux[V]
that will emit elements from the provided Publisher.
the element type of the supplied Publisher
a Publisher to emit from after termination
a new Flux that emits from the supplied Publisher after this Mono completes.
Switch to a fallback Publisher in case the item from this Mono has not been emitted before the given Publisher emits.
Switch to a fallback Publisher in case the item from this Mono has not been emitted before the given Publisher emits. The following items will be individually timed via the factory provided Publisher.
Signal a java.util.concurrent.TimeoutException in case the item from this Mono has not been emitted before the given Publisher emits.
Signal a java.util.concurrent.TimeoutException in case the item from this Mono has not been emitted before the given Publisher emits.
Switch to a fallback Mono in case an item doesn't arrive before the given period.
Switch to a fallback Mono in case an item doesn't arrive before the given period.
If the given Publisher
is None, signal a java.util.concurrent.TimeoutException.
Signal a java.util.concurrent.TimeoutException error in case an item doesn't arrive before the given period.
Switch to a fallback Mono in case an item doesn't arrive before the given period.
Switch to a fallback Mono in case an item doesn't arrive before the given period.
If the given Publisher is null, signal a java.util.concurrent.TimeoutException.
Signal a java.util.concurrent.TimeoutException in case an item doesn't arrive before the given period.
Emit a Tuple2 pair of T1 Long current system time in
millis and T2 T
associated data for the eventual item from this Mono
Emit a Tuple2 pair of T1 Long current system time in
millis and T2 T
associated data for the eventual item from this Mono
Transform this Mono into a Future completing on onNext or onComplete and failing on onError.
Transform this Mono into a Future completing on onNext or onComplete and failing on onError.
a Future
Transform this Mono in order to generate a target Mono.
Transform this Mono in order to generate a target Mono. Unlike Mono.compose, the provided function is executed as part of assembly.
the item type in the returned Mono
the Function1 to immediately map this Mono into a target Mono instance.
a new Mono
val applySchedulers = mono => mono.subscribeOn(Schedulers.elastic()).publishOn(Schedulers.parallel()); mono.transform(applySchedulers).map(v => v * v).subscribe()
Mono.as for a loose conversion to an arbitrary type
Mono.compose for deferred composition of Mono for each Subscriber
Subscribe to this Mono and another Publisher, which will be used as a trigger for the emission of this Mono's element.
Subscribe to this Mono and another Publisher, which will be used as a trigger for the emission of this Mono's element. That is to say, this Mono's element is delayed until the trigger Publisher emits for the first time (or terminates empty).
the publisher which first emission or termination will trigger the emission of this Mono's value.
this Mono, but delayed until the given publisher emits first or terminates.
Subscribe to this Mono and another Publisher, which will be used as a trigger for the emission of this Mono's element, mapped through a provided function.
Subscribe to this Mono and another Publisher, which will be used as a trigger for the emission of this Mono's element, mapped through a provided function. That is to say, this Mono's element is delayed until the trigger Publisher emits for the first time (or terminates empty). Any error is delayed until all publishers have triggered, and multiple errors are combined into one.
the publisher which first emission or termination will trigger the emission of this Mono's value.
this Mono, but delayed until the given publisher emits first or terminates.
A Reactive Streams Publisher with basic rx operators that completes successfully by emitting an element, or with an error.
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 Flux with possibly more than 1 emission. Its alternative enforcing Mono input is then.
Mono[Unit]
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
scala.Function
/ lambdas used within Mono operators should be avoided, as these may be shared between several Subscribers.the type of the single value of this class
Flux