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>| Modifier and Type | Field and Description |
|---|---|
protected CoreSubscriber<? super O> |
actual |
protected O |
value
The value stored by this Mono operator.
|
OPERATOR_NAME_UNRELATED_WORDS_PATTERNNOT_SUPPORTED_MESSAGE| Constructor and Description |
|---|
MonoSubscriber(CoreSubscriber<? super O> actual) |
| Modifier and Type | Method and Description |
|---|---|
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. |
protected void |
discard(O v)
Discard the given value, generally this.value field.
|
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(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() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitactuals, from, inners, isScanAvailable, name, parents, scan, scanOrDefault, stepName, steps, tags, tagsDeduplicatedfusionModeName, fusionModeNameadd, addAll, contains, containsAll, element, iterator, offer, peek, remove, remove, removeAll, retainAll, toArray, toArrayprotected final CoreSubscriber<? super O> actual
@Nullable protected O value
setValue(Object)
rather than direct writes to this field, when possible.public MonoSubscriber(CoreSubscriber<? super O> actual)
public void cancel()
cancel in interface Subscription@Nullable public java.lang.Object scanUnsafe(Scannable.Attr key)
ScannableScannable.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 in interface java.util.Collection<O>public final void complete(@Nullable O v)
Make sure this method is called at most once
v - the value to emitprotected void discard(@Nullable O v)
v - the value to discardpublic final CoreSubscriber<? super O> actual()
public final boolean isCancelled()
public final boolean isEmpty()
isEmpty in interface java.util.Collection<O>public void onComplete()
public void onError(java.lang.Throwable t)
public void onNext(I t)
public void onSubscribe(Subscription s)
CoreSubscriberSubscriber.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 in interface Subscriptionpublic int requestFusion(int mode)
Fuseable.QueueSubscriptionOne 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 in interface 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 in interface java.util.Collection<O>public Context currentContext()
CoreSubscriberContext from dependent components which can include downstream
operators during subscribing or a terminal Subscriber.Context.empty()