Top Description Fields Constructors Methods
rx.internal.producers

public final Class ProducerArbiter

extends Object
implements Producer
Class Inheritance
All Implemented Interfaces
rx.Producer
Imports
rx.*

Producer that allows changing an underlying producer atomically and correctly resume with the accumulated requests.

Field Summary

Modifier and TypeField and Description
pack-priv Producer
pack-priv boolean
pack-priv long
pack-priv Producer
pack-priv long
pack-priv static final Producer
pack-priv long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
produced(long n)

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
setProducer(Producer newProducer)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentProducerback to summary
pack-priv Producer currentProducer
emittingback to summary
pack-priv boolean emitting
missedProducedback to summary
pack-priv long missedProduced
missedProducerback to summary
pack-priv Producer missedProducer
missedRequestedback to summary
pack-priv long missedRequested
NULL_PRODUCERback to summary
pack-priv static final Producer NULL_PRODUCER
requestedback to summary
pack-priv long requested

Constructor Detail

ProducerArbiterback to summary
public ProducerArbiter()

Method Detail

emitLoopback to summary
public void emitLoop()
producedback to summary
public void produced(long n)
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 newProducer)