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 org.reactivestreams.Processor<O,O>, CoreSubscriber<O>, Disposable, org.reactivestreams.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
构造器和说明 |
---|
MonoProcessor()
已过时。
|
限定符和类型 | 方法和说明 |
---|---|
O |
block()
已过时。
Block the calling thread indefinitely, waiting for the completion of this
MonoProcessor . |
O |
block(java.time.Duration timeout)
已过时。
Block the calling thread for the specified time, waiting for the completion of this
MonoProcessor . |
void |
cancel()
已过时。
the
MonoProcessor will cease to implement Subscription in 3.5 |
static <T> MonoProcessor<T> |
create()
已过时。
Use
Sinks.one() , to be removed in 3.5 |
Context |
currentContext()
已过时。
Request a
Context from dependent components which can include downstream
operators during subscribing or a terminal Subscriber . |
void |
dispose()
已过时。
Cancel or dispose the underlying task or resource.
|
long |
downstreamCount()
已过时。
Return the number of active
Subscriber or -1 if untracked. |
java.lang.Throwable |
getError()
已过时。
Return the produced
Throwable error if any or null |
boolean |
hasDownstreams()
已过时。
Return true if any
Subscriber is actively subscribed |
java.util.stream.Stream<? extends Scannable> |
inners()
已过时。
Return a
Stream of referenced inners (flatmap, multicast etc) |
boolean |
isCancelled()
已过时。
the
MonoProcessor will cease to implement Subscription and this method will be removed in 3.5 |
boolean |
isDisposed()
已过时。
Optionally return true when the resource or task is disposed.
|
boolean |
isError()
已过时。
Indicates whether this
MonoProcessor has been completed with an error. |
boolean |
isSuccess()
已过时。
Indicates whether this
MonoProcessor has been successfully completed a value. |
boolean |
isTerminated()
已过时。
Indicates whether this
MonoProcessor has been terminated by the
source producer with a success or an error. |
O |
peek()
已过时。
this method is discouraged, consider peeking into a MonoProcessor by
turning it into a CompletableFuture |
void |
request(long n)
已过时。
the
MonoProcessor will cease to implement Subscription in 3.5 |
java.lang.Object |
scanUnsafe(Scannable.Attr key)
已过时。
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, 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, 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, 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
onSubscribe
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
在接口中 org.reactivestreams.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
在接口中 org.reactivestreams.Subscription
n
- the request amountpublic void dispose()
Disposable
Implementations are required to make this method idempotent.
dispose
在接口中 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 java.time.Duration timeout)
MonoProcessor
. If the
MonoProcessor
is completed with an error a RuntimeException that wraps the error is thrown.@Nullable public java.lang.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
在接口中 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 completedjava.lang.RuntimeException
- 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
在接口中 CoreSubscriber<O>
Context.empty()
@Nullable public java.lang.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
在接口中 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