I
- The upstream sequence typeO
- The downstream sequence typepublic static class Operators.MonoSubscriber<I,O> extends java.lang.Object implements Fuseable, Fuseable.QueueSubscription<O>
Scannable.Attr<T>
Fuseable.ConditionalSubscriber<T>, Fuseable.QueueSubscription<T>, Fuseable.ScalarCallable<T>, Fuseable.SynchronousSubscription<T>
OPERATOR_NAME_UNRELATED_WORDS_PATTERN
NOT_SUPPORTED_MESSAGE
构造器和说明 |
---|
MonoSubscriber(CoreSubscriber<? super O> actual) |
限定符和类型 | 方法和说明 |
---|---|
CoreSubscriber<? super O> |
actual() |
void |
cancel() |
void |
clear() |
void |
complete(O v)
Tries to emit the value and complete the underlying subscriber or
stores the value away until there is a request for it.
|
default Context |
currentContext()
Request a
Context from dependent components which can include downstream
operators during subscribing or a terminal Subscriber . |
boolean |
isCancelled()
Returns true if this Subscription has been cancelled.
|
boolean |
isEmpty() |
void |
onComplete() |
void |
onError(java.lang.Throwable t) |
void |
onNext(I t) |
void |
onSubscribe(org.reactivestreams.Subscription s)
Implementors should initialize any state used by
Subscriber.onNext(Object) before
calling Subscription.request(long) . |
O |
poll() |
void |
request(long n) |
int |
requestFusion(int mode)
Request a specific fusion mode from this QueueSubscription.
|
java.lang.Object |
scanUnsafe(Scannable.Attr key)
This method is used internally by components to define their key-value mappings
in a single place.
|
void |
setValue(O value)
Set the value internally, without impacting request tracking state.
|
int |
size() |
actuals, from, inners, isScanAvailable, name, parents, scan, scanOrDefault, stepName, steps, tags, tagsDeduplicated
fusionModeName, fusionModeName
public MonoSubscriber(CoreSubscriber<? super O> actual)
public void cancel()
cancel
在接口中 org.reactivestreams.Subscription
@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.
key
- a Scannable.Attr
to resolve for the component.public final void clear()
clear
在接口中 java.util.Collection<O>
public final void complete(@Nullable O v)
Make sure this method is called at most once
v
- the value to emitpublic final CoreSubscriber<? super O> actual()
public final boolean isCancelled()
public final boolean isEmpty()
isEmpty
在接口中 java.util.Collection<O>
public void onComplete()
public void onError(java.lang.Throwable t)
public void onNext(I t)
public void onSubscribe(org.reactivestreams.Subscription s)
CoreSubscriber
Subscriber.onNext(Object)
before
calling Subscription.request(long)
. Should further onNext
related
state modification occur, thread-safety will be required.
Note that an invalid request <= 0
will not produce an onError and
will simply be ignored or reported through a debug-enabled
Logger
.
public void request(long n)
request
在接口中 org.reactivestreams.Subscription
public int requestFusion(int mode)
Fuseable.QueueSubscription
One should request either SYNC, ASYNC or ANY modes (never NONE) and the implementor should return NONE, SYNC or ASYNC (never ANY).
For example, if a source supports only ASYNC fusion but the intermediate operator supports only SYNC fuseable sources, the operator may request SYNC fusion and the source can reject it via NONE, thus the operator can return NONE as well to downstream and the fusion doesn't happen.
requestFusion
在接口中 Fuseable.QueueSubscription<O>
mode
- the mode requested by the intermediate operatorpublic void setValue(@Nullable O value)
value
- the new value.complete(Object)
public int size()
size
在接口中 java.util.Collection<O>
public Context currentContext()
CoreSubscriber
Context
from dependent components which can include downstream
operators during subscribing or a terminal Subscriber
.Context.empty()