I
- The upstream sequence typeO
- The downstream sequence typepublic static class Operators.MonoSubscriber<I,O> extends java.lang.Object implements org.reactivestreams.Subscriber<I>, Loopback, Trackable, Receiver, Producer, Fuseable.QueueSubscription<O>
Modifier and Type | Field and Description |
---|---|
protected byte |
outputFused |
protected org.reactivestreams.Subscriber<? super O> |
subscriber |
protected O |
value |
UNSPECIFIED
Constructor and Description |
---|
MonoSubscriber(org.reactivestreams.Subscriber<? super O> subscriber) |
Modifier and Type | Method and Description |
---|---|
void |
cancel() |
void |
clear() |
void |
complete(O value)
Tries to emit the value and complete the underlying subscriber or
stores the value away until there is a request for it.
|
java.lang.Object |
connectedOutput() |
org.reactivestreams.Subscriber<? super O> |
downstream()
Return the direct data receiver.
|
boolean |
isCancelled() |
boolean |
isEmpty() |
boolean |
isStarted()
Has this upstream started or "onSubscribed" ?
|
boolean |
isTerminated()
Has this upstream finished or "completed" / "failed" ?
|
void |
onComplete() |
void |
onError(java.lang.Throwable t) |
void |
onNext(I t) |
void |
onSubscribe(org.reactivestreams.Subscription s) |
O |
poll() |
void |
request(long n) |
int |
requestFusion(int requestedMode)
Request a specific fusion mode from this QueueSubscription.
|
void |
setValue(O value) |
int |
size() |
java.lang.Object |
upstream()
Return the direct source of data, Supports reference.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connectedInput
expectedFromUpstream, getCapacity, getError, getPending, limit, requestedFromDownstream
add, addAll, contains, containsAll, element, iterator, offer, peek, remove, remove, removeAll, retainAll, toArray, toArray
protected final org.reactivestreams.Subscriber<? super O> subscriber
protected O value
protected byte outputFused
public MonoSubscriber(org.reactivestreams.Subscriber<? super O> subscriber)
public void request(long n)
request
in interface org.reactivestreams.Subscription
public void cancel()
cancel
in interface org.reactivestreams.Subscription
public void onError(java.lang.Throwable t)
onError
in interface org.reactivestreams.Subscriber<I>
public void onSubscribe(org.reactivestreams.Subscription s)
onSubscribe
in interface org.reactivestreams.Subscriber<I>
public void onComplete()
onComplete
in interface org.reactivestreams.Subscriber<I>
public final boolean isCancelled()
isCancelled
in interface Trackable
public final org.reactivestreams.Subscriber<? super O> downstream()
Producer
downstream
in interface Producer
public void setValue(O value)
public final void complete(O value)
Make sure this method is called at most once
value
- the value to emitpublic boolean isStarted()
Trackable
public java.lang.Object connectedOutput()
connectedOutput
in interface Loopback
null
if unavailablepublic boolean isTerminated()
Trackable
isTerminated
in interface Trackable
public java.lang.Object upstream()
Receiver
public int requestFusion(int requestedMode)
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 dowstream and the fusion doesn't happen.
requestFusion
in interface Fuseable.QueueSubscription<O>
requestedMode
- the mode to requestpublic boolean isEmpty()
isEmpty
in interface java.util.Collection<O>
public void clear()
clear
in interface java.util.Collection<O>
public int size()
size
in interface java.util.Collection<O>