Store any temporary value in value and indicate there is
a value available when completing by setting hasValue.
subscribeTo(Observable) to properly setup the link between this and the downstream
subscriber.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | DeferredScalarSubscriber.InnerProducer
Redirects the downstream request amount bach to the DeferredScalarSubscriber. |
| Modifier and Type | Field and Description |
|---|---|
| protected final Subscriber | actual
The downstream subscriber. |
| pack-priv static final int | HAS_REQUEST_HAS_VALUE
Value will be emitted. |
| pack-priv static final int | HAS_REQUEST_NO_VALUE
Request came first. |
| protected boolean | hasValue
Indicates there is a value available in value. |
| pack-priv static final int | NO_REQUEST_HAS_VALUE
Value came first. |
| pack-priv static final int | NO_REQUEST_NO_VALUE
Initial state. |
| pack-priv final AtomicInteger | state
The state, see the constants below. |
| protected R | value
The holder of the single value. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected final void | |
| protected final void | complete(R
the value to complete with value)Atomically switches to the terminal state and emits the value if
there is a request for it or stores it for retrieval by |
| pack-priv final void | |
| public void | onCompleted()
Implements rx. Observable has finished sending push-based notifications.
|
| public void | onError(Throwable
the exception encountered by the Observable ex)Implements rx. Observable has experienced an error condition.
|
| public final void | setProducer(Producer
producer to be used by this subscriber or the other subscriber
(or recursively its other subscriber) to make requests from p)Overrides rx. Subscriber(Subscriber) or
Subscriber(Subscriber, boolean)) then this method calls
setProducer on the other subscriber.
|
| pack-priv final void | |
| public final void | subscribeTo(Observable<? extends T>
the source Observable source)Links up with the downstream Subscriber (cancellation, backpressure) and subscribes to the source Observable. |
| actual | back to summary |
|---|---|
| protected final Subscriber<? super R> actual The downstream subscriber. | |
| HAS_REQUEST_HAS_VALUE | back to summary |
|---|---|
| pack-priv static final int HAS_REQUEST_HAS_VALUE Value will be emitted. | |
| HAS_REQUEST_NO_VALUE | back to summary |
|---|---|
| pack-priv static final int HAS_REQUEST_NO_VALUE Request came first. | |
| hasValue | back to summary |
|---|---|
| protected boolean hasValue Indicates there is a value available in value. | |
| NO_REQUEST_HAS_VALUE | back to summary |
|---|---|
| pack-priv static final int NO_REQUEST_HAS_VALUE Value came first. | |
| NO_REQUEST_NO_VALUE | back to summary |
|---|---|
| pack-priv static final int NO_REQUEST_NO_VALUE Initial state. | |
| state | back to summary |
|---|---|
| pack-priv final AtomicInteger state The state, see the constants below. | |
| value | back to summary |
|---|---|
| protected R value The holder of the single value. | |
| DeferredScalarSubscriber | back to summary |
|---|---|
| public DeferredScalarSubscriber(Subscriber<? super R> actual) | |
| complete | back to summary |
|---|---|
| protected final void complete() Signals onCompleted() to the downstream subscriber. | |
| complete | back to summary |
|---|---|
| protected final void complete(R value) Atomically switches to the terminal state and emits the value if
there is a request for it or stores it for retrieval by
| |
| downstreamRequest | back to summary |
|---|---|
| pack-priv final void downstreamRequest(long n) | |
| onCompleted | back to summary |
|---|---|
| public void onCompleted() Implements rx. Doc from rx. Notifies the Observer that the
The
| |
| onError | back to summary |
|---|---|
| public void onError(Throwable ex) Implements rx. Doc from rx. Notifies the Observer that the
If the | |
| setProducer | back to summary |
|---|---|
| public final void setProducer(Producer p) Overrides rx. Doc from rx. If other subscriber is set (by calling constructor
| |
| setupDownstream | back to summary |
|---|---|
| pack-priv final void setupDownstream() | |
| subscribeTo | back to summary |
|---|---|
| public final void subscribeTo(Observable<? extends T> source) Links up with the downstream Subscriber (cancellation, backpressure) and subscribes to the source Observable.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final DeferredScalarSubscriber |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | request(long
the maximum number of items you want this Producer to produce, or n)Long.MAX_VALUE if you
want the Producer to produce items at its own paceImplements rx. |
| parent | back to summary |
|---|---|
| pack-priv final DeferredScalarSubscriber<?, ?> parent | |
| InnerProducer | back to summary |
|---|---|
| public InnerProducer(DeferredScalarSubscriber<?, ?> parent) | |
| request | back to summary |
|---|---|
| public void request(long n) Implements rx. Doc from rx. Request a certain maximum number of items from this Producer. This is a way of requesting backpressure.
To disable backpressure, pass
Requests are additive but if a sequence of requests totals more than request(100); request(Long.MAX_VALUE-1);
| |