O
- the type of the value that will be made availableSinks.One
or Sinks.Empty
instead,
or see https://github.com/reactor/reactor-core/issues/2431 for alternatives@Deprecated public abstract class MonoProcessor<O> extends Mono<O> implements Processor<O,O>, CoreSubscriber<O>, Disposable, Subscription, Scannable
MonoProcessor
is a Processor
that is also a Mono
.
Implementations might implements stateful semantics, allowing multiple subscriptions.
Once a MonoProcessor
has been resolved, implementations may also replay cached signals to newer subscribers.
Despite having default implementations, most methods should be reimplemented with meaningful semantics relevant to concrete child classes.
Disposable.Composite, Disposable.Swap
Scannable.Attr<T>
OPERATOR_NAME_UNRELATED_WORDS_PATTERN
Constructor and Description |
---|
MonoProcessor()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
O |
block()
Deprecated.
Block the calling thread indefinitely, waiting for the completion of this
MonoProcessor . |
O |
block(Duration timeout)
Deprecated.
Block the calling thread for the specified time, waiting for the completion of this
MonoProcessor . |
void |
cancel()
Deprecated.
the
MonoProcessor will cease to implement Subscription in 3.5 |
static <T> MonoProcessor<T> |
create()
Deprecated.
Use
Sinks.one() , to be removed in 3.5 |
Context |
currentContext()
Deprecated.
Request a
Context from dependent components which can include downstream
operators during subscribing or a terminal Subscriber . |
void |
dispose()
Deprecated.
Cancel or dispose the underlying task or resource.
|
long |
downstreamCount()
Deprecated.
Return the number of active
Subscriber or -1 if untracked. |
Throwable |
getError()
Deprecated.
Return the produced
Throwable error if any or null |
boolean |
hasDownstreams()
Deprecated.
Return true if any
Subscriber is actively subscribed |
Stream<? extends Scannable> |
inners()
Deprecated.
Return a
Stream of referenced inners (flatmap, multicast etc) |
boolean |
isCancelled()
Deprecated.
the
MonoProcessor will cease to implement Subscription and this method will be removed in 3.5 |
boolean |
isDisposed()
Deprecated.
Optionally return true when the resource or task is disposed.
|
boolean |
isError()
Deprecated.
Indicates whether this
MonoProcessor has been completed with an error. |
boolean |
isSuccess()
Deprecated.
Indicates whether this
MonoProcessor has been successfully completed a value. |
boolean |
isTerminated()
Deprecated.
Indicates whether this
MonoProcessor has been terminated by the
source producer with a success or an error. |
O |
peek()
Deprecated.
this method is discouraged, consider peeking into a MonoProcessor by
turning it into a CompletableFuture |
void |
request(long n)
Deprecated.
the
MonoProcessor will cease to implement Subscription in 3.5 |
Object |
scanUnsafe(Scannable.Attr key)
Deprecated.
This method is used internally by components to define their key-value mappings
in a single place.
|
and, as, blockOptional, blockOptional, cache, cache, cache, cache, cache, cacheInvalidateIf, cacheInvalidateWhen, cacheInvalidateWhen, cancelOn, cast, checkpoint, checkpoint, checkpoint, concatWith, contextCapture, contextWrite, contextWrite, create, defaultIfEmpty, defer, deferContextual, delay, delay, delayElement, delayElement, delaySubscription, delaySubscription, delaySubscription, delayUntil, dematerialize, doAfterTerminate, doFinally, doFirst, doOnCancel, doOnDiscard, doOnEach, doOnError, doOnError, doOnError, doOnNext, doOnRequest, doOnSubscribe, doOnSuccess, doOnTerminate, elapsed, elapsed, empty, error, error, expand, expand, expandDeep, expandDeep, filter, filterWhen, first, first, firstWithSignal, firstWithSignal, firstWithValue, firstWithValue, flatMap, flatMapIterable, flatMapMany, flatMapMany, flux, from, fromCallable, fromCompletionStage, fromCompletionStage, fromDirect, fromFuture, fromFuture, fromFuture, fromFuture, fromRunnable, fromSupplier, handle, hasElement, hide, ignoreElement, ignoreElements, just, justOrEmpty, justOrEmpty, log, log, log, log, log, log, map, mapNotNull, materialize, mergeWith, metrics, name, never, ofType, onAssembly, onErrorComplete, onErrorComplete, onErrorComplete, onErrorContinue, onErrorContinue, onErrorContinue, onErrorMap, onErrorMap, onErrorMap, onErrorResume, onErrorResume, onErrorResume, onErrorReturn, onErrorReturn, onErrorReturn, onErrorStop, onTerminateDetach, or, publish, publishOn, repeat, repeat, repeat, repeat, repeatWhen, repeatWhenEmpty, repeatWhenEmpty, retry, retry, retryWhen, sequenceEqual, sequenceEqual, sequenceEqual, share, single, singleOptional, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribeOn, subscribeWith, switchIfEmpty, tag, take, take, takeUntilOther, tap, tap, tap, then, then, thenEmpty, thenMany, thenReturn, timed, timed, timeout, timeout, timeout, timeout, timeout, timeout, timestamp, timestamp, toFuture, toString, transform, transformDeferred, transformDeferredContextual, using, using, using, using, usingWhen, usingWhen, when, when, whenDelayError, whenDelayError, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zipDelayError, zipDelayError, zipDelayError, zipDelayError, zipDelayError, zipDelayError, zipDelayError, zipDelayError, zipDelayError, zipWhen, zipWhen, zipWith, zipWith
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
onSubscribe
onComplete, onError, onNext
actuals, from, isScanAvailable, name, parents, scan, scanOrDefault, stepName, steps, tags, tagsDeduplicated
@Deprecated public static <T> MonoProcessor<T> create()
Sinks.one()
, to be removed in 3.5MonoProcessor
that will eagerly request 1 on Subscriber.onSubscribe(Subscription)
, cache and emit
the eventual result for 1 or N subscribers.T
- type of the expected valueMonoProcessor
.@Deprecated public void cancel()
MonoProcessor
will cease to implement Subscription
in 3.5cancel
in interface Subscription
@Deprecated public boolean isCancelled()
MonoProcessor
will cease to implement Subscription
and this method will be removed in 3.5MonoProcessor
has been interrupted via cancellation.true
if this MonoProcessor
is cancelled, false
otherwise.@Deprecated public void request(long n)
MonoProcessor
will cease to implement Subscription
in 3.5request
in interface Subscription
n
- the request amountpublic void dispose()
Disposable
Implementations are required to make this method idempotent.
dispose
in interface Disposable
@Nullable public O block()
MonoProcessor
. If the
MonoProcessor
is completed with an error a RuntimeException that wraps the error is thrown.@Nullable public O block(@Nullable Duration timeout)
MonoProcessor
. If the
MonoProcessor
is completed with an error a RuntimeException that wraps the error is thrown.@Nullable public Throwable getError()
Throwable
error if any or nullThrowable
error if any or nullpublic final boolean isError()
MonoProcessor
has been completed with an error.true
if this MonoProcessor
was completed with an error, false
otherwise.public final boolean isSuccess()
MonoProcessor
has been successfully completed a value.true
if this MonoProcessor
is successful, false
otherwise.public boolean isTerminated()
MonoProcessor
has been terminated by the
source producer with a success or an error.true
if this MonoProcessor
is successful, false
otherwise.public boolean isDisposed()
Disposable
Implementations are not required to track disposition and as such may never return true even when disposed. However, they MUST only return true when there's a guarantee the resource or task is disposed.
isDisposed
in interface Disposable
@Nullable @Deprecated public O peek()
turning it into a CompletableFuture
MonoProcessor
. Returns null
if the MonoProcessor
has not been completed. If the
MonoProcessor
is completed with an error a RuntimeException that wraps the error is thrown.MonoProcessor
, or null
if it has not been completedRuntimeException
- if the MonoProcessor
was completed with an errorpublic Context currentContext()
CoreSubscriber
Context
from dependent components which can include downstream
operators during subscribing or a terminal Subscriber
.currentContext
in interface CoreSubscriber<O>
Context.empty()
@Nullable public Object scanUnsafe(Scannable.Attr key)
Scannable
Scannable.Attr
key,
implementors should take care to return values of the correct type, and return
null if no specific value is available.
For public consumption of attributes, prefer using Scannable.scan(Attr)
, which will
return a typed value and fall back to the key's default if the component didn't
define any mapping.
scanUnsafe
in interface Scannable
key
- a Scannable.Attr
to resolve for the component.public long downstreamCount()
Subscriber
or -1 if untracked.Subscriber
or -1 if untrackedpublic final boolean hasDownstreams()
Subscriber
is actively subscribedSubscriber
is actively subscribed