I - The upstream sequence typeO - The downstream sequence typepublic static class Operators.MonoSubscriber<I,O> extends Object implements Subscriber<I>, Trackable, Receiver, Producer, Fuseable, Fuseable.QueueSubscription<O>
Fuseable.ConditionalSubscriber<T>, Fuseable.QueueSubscription<T>, Fuseable.ScalarCallable<T>, Fuseable.SynchronousSubscription<T>| Modifier and Type | Field and Description |
|---|---|
protected Subscriber<? super O> |
actual |
protected O |
value |
UNSPECIFIED| Constructor and Description |
|---|
MonoSubscriber(Subscriber<? super O> actual) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
Subscriber<? super O> |
downstream()
Return the direct data receiver.
|
boolean |
isCancelled()
Returns true if this Subscription has been cancelled.
|
boolean |
isEmpty() |
boolean |
isStarted()
Has this upstream started or "onSubscribed" ?
|
boolean |
isTerminated()
Has this upstream finished or "completed" / "failed" ?
|
void |
onComplete() |
void |
onError(Throwable t) |
void |
onNext(I t) |
void |
onSubscribe(Subscription s) |
O |
poll() |
void |
request(long n) |
int |
requestFusion(int mode)
Request a specific fusion mode from this QueueSubscription.
|
void |
setValue(O value) |
int |
size() |
Object |
upstream()
Return the direct source of data, Supports reference.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexpectedFromUpstream, getCapacity, getError, getPending, limit, requestedFromDownstreamadd, addAll, contains, containsAll, element, iterator, offer, peek, remove, remove, removeAll, retainAll, toArray, toArrayequals, hashCode, parallelStream, removeIf, spliterator, streamprotected final Subscriber<? super O> actual
protected O value
public MonoSubscriber(Subscriber<? super O> actual)
public void cancel()
cancel in interface Subscriptionpublic final void clear()
clear in interface Collection<O>public final void complete(O v)
Make sure this method is called at most once
v - the value to emitpublic final Subscriber<? super O> downstream()
Producerdownstream in interface Producerpublic final boolean isCancelled()
isCancelled in interface Trackablepublic final boolean isEmpty()
isEmpty in interface Collection<O>public boolean isStarted()
Trackablepublic boolean isTerminated()
TrackableisTerminated in interface Trackablepublic void onComplete()
onComplete in interface Subscriber<I>public void onError(Throwable t)
onError in interface Subscriber<I>public void onNext(I t)
onNext in interface Subscriber<I>public void onSubscribe(Subscription s)
onSubscribe in interface Subscriber<I>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 dowstream and the fusion doesn't happen.
requestFusion in interface Fuseable.QueueSubscription<O>mode - the mode to requestpublic void setValue(O value)
public int size()
size in interface Collection<O>