Top Description Fields Constructors Methods
rx.internal.producers

public final Class ProducerObserverArbiter<T>

extends Object
implements Producer, Observer<T>
Class Inheritance
All Implemented Interfaces
rx.Observer, rx.Producer
Type Parameters
<T>
the value type
Imports
java.util.*, rx.*, .Observer, rx.exceptions.*, rx.internal.operators.BackpressureUtils

Producer that serializes any event emission with requesting and producer changes.

The implementation shortcuts on error and overwrites producers that got delayed, similar to ProducerArbiter.

Field Summary

Modifier and TypeField and Description
pack-priv final Subscriber<? super T>
pack-priv Producer
pack-priv boolean
pack-priv volatile boolean
pack-priv Producer
pack-priv long
pack-priv Object
pack-priv static final Producer
pack-priv List<T>
pack-priv long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv void
public void
onCompleted()

Implements rx.Observer.onCompleted.

Notifies the Observer that the Observable has finished sending push-based notifications.
public void
onError(Throwable
the exception encountered by the Observable
e
)

Implements rx.Observer.onError.

Notifies the Observer that the Observable has experienced an error condition.
public void
onNext(T
the item emitted by the Observable
t
)

Implements rx.Observer.onNext.

Provides the Observer with a new item to observe.
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
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

childback to summary
pack-priv final Subscriber<? super T> child
currentProducerback to summary
pack-priv Producer currentProducer
emittingback to summary
pack-priv boolean emitting
hasErrorback to summary
pack-priv volatile boolean hasError
missedProducerback to summary
pack-priv Producer missedProducer
missedRequestedback to summary
pack-priv long missedRequested
missedTerminalback to summary
pack-priv Object missedTerminal
NULL_PRODUCERback to summary
pack-priv static final Producer NULL_PRODUCER
queueback to summary
pack-priv List<T> queue
requestedback to summary
pack-priv long requested

Constructor Detail

ProducerObserverArbiterback to summary
public ProducerObserverArbiter(Subscriber<? super T> child)

Method Detail

emitLoopback to summary
pack-priv void emitLoop()
onCompletedback to summary
public void onCompleted()

Implements rx.Observer.onCompleted.

Doc from rx.Observer.onCompleted.

Notifies the Observer that the Observable has finished sending push-based notifications.

The Observable will not call this method if it calls onError.

Annotations
@Override
onErrorback to summary
public void onError(Throwable e)

Implements rx.Observer.onError.

Doc from rx.Observer.onError.

Notifies the Observer that the Observable has experienced an error condition.

If the Observable calls this method, it will not thereafter call onNext or onCompleted.

Parameters
e:Throwable

the exception encountered by the Observable

Annotations
@Override
onNextback to summary
public void onNext(T t)

Implements rx.Observer.onNext.

Doc from rx.Observer.onNext.

Provides the Observer with a new item to observe.

The Observable may call this method 0 or more times.

The Observable will not call this method again after it calls either onCompleted or onError.

Parameters
t:T

the item emitted by the Observable

Annotations
@Override
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
setProducerback to summary
public void setProducer(Producer p)