Top Description Fields Constructors Methods
rx.internal.producers

public final Class SingleDelayedProducer<T>

extends AtomicInteger
implements Producer
Class Inheritance
All Implemented Interfaces
rx.Producer
Type Parameters
<T>
the value type
Imports
java.util.concurrent.atomic.AtomicInteger, rx.*, rx.exceptions.*

Producer that emits a single value and completes the child subscriber once that single value is set on it and the child requested items (maybe both asynchronously).

Field Summary

Modifier and TypeField and Description
pack-priv final Subscriber<? super T>
child

The child to emit the value and completion once possible.

pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
private static final long
pack-priv T

Constructor Summary

AccessConstructor and Description
public
SingleDelayedProducer(Subscriber<? super T>
the child subscriber, not null
child
)

Constructor, wraps the target child subscriber.

Method Summary

Modifier and TypeMethod and Description
private static <T> void
emit(Subscriber<? super T>
the target Subscriber to emit to
c
,
T
the value to emit
v
)

Emits the given value to the child subscriber and completes it and checks for unsubscriptions eagerly.

public void
request(long
the maximum number of items you want this Producer to produce, or Long.MAX_VALUE if you want the Producer to produce items at its own pace
n
)

Implements rx.Producer.request.

Request a certain maximum number of items from this Producer.
public void
setValue(T value)

Inherited from java.util.concurrent.atomic.AtomicInteger:
accumulateAndGetaddAndGetcompareAndExchangecompareAndExchangeAcquirecompareAndExchangeReleasecompareAndSetdecrementAndGetdoubleValuefloatValuegetgetAcquiregetAndAccumulategetAndAddgetAndDecrementgetAndIncrementgetAndSetgetAndUpdategetOpaquegetPlainincrementAndGetintValuelazySetlongValuesetsetOpaquesetPlainsetReleasetoStringupdateAndGetweakCompareAndSetweakCompareAndSetAcquireweakCompareAndSetPlainweakCompareAndSetReleaseweakCompareAndSetVolatile

Field Detail

childback to summary
pack-priv final Subscriber<? super T> child

The child to emit the value and completion once possible.

HAS_REQUEST_HAS_VALUEback to summary
pack-priv static final int HAS_REQUEST_HAS_VALUE
HAS_REQUEST_NO_VALUEback to summary
pack-priv static final int HAS_REQUEST_NO_VALUE
NO_REQUEST_HAS_VALUEback to summary
pack-priv static final int NO_REQUEST_HAS_VALUE
NO_REQUEST_NO_VALUEback to summary
pack-priv static final int NO_REQUEST_NO_VALUE
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.concurrent.atomic.AtomicInteger.serialVersionUID.

valueback to summary
pack-priv T value

Hides java.util.concurrent.atomic.AtomicInteger.value.

The value to emit.

Constructor Detail

SingleDelayedProducerback to summary
public SingleDelayedProducer(Subscriber<? super T> child)

Constructor, wraps the target child subscriber.

Parameters
child:Subscriber<? super T>

the child subscriber, not null

Method Detail

emitback to summary
private static <T> void emit(Subscriber<? super T> c, T v)

Emits the given value to the child subscriber and completes it and checks for unsubscriptions eagerly.

Parameters
c:Subscriber<? super T>

the target Subscriber to emit to

v:T

the value to emit

requestback to summary
public void request(long n)

Implements rx.Producer.request.

Doc from rx.Producer.request.

Request a certain maximum number of items from this Producer. This is a way of requesting backpressure. To disable backpressure, pass Long.MAX_VALUE to this method.

Requests are additive but if a sequence of requests totals more than Long.MAX_VALUE then Long.MAX_VALUE requests will be actioned and the extras may be ignored. Arriving at Long.MAX_VALUE by addition of requests cannot be assumed to disable backpressure. For example, the code below may result in Long.MAX_VALUE requests being actioned only.

request(100);
request(Long.MAX_VALUE-1);
Parameters
n:long

the maximum number of items you want this Producer to produce, or Long.MAX_VALUE if you want the Producer to produce items at its own pace

Annotations
@Override
setValueback to summary
public void setValue(T value)