Observable source and stores them in a buffer. Periodically the buffer
is emitted and replaced with a new buffer. How often this is done depends on the specified timespan.
The creation of chunks is also periodical. How often this is done depends on the specified timeshift.
When the source Observable completes or produces an error, the current buffer is emitted, and
the event is propagated to all subscribed Subscribers.
Note that this operation can produce non-connected, or overlapping chunks depending on the input parameters.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class | OperatorBufferWithTime.ExactSubscriber
Subscriber when exact timed chunking is required. |
| pack-priv class | OperatorBufferWithTime.InexactSubscriber
Subscriber when the buffer chunking time and length differ. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final int | |
| pack-priv final Scheduler | |
| pack-priv final long | |
| pack-priv final long | |
| pack-priv final TimeUnit |
| Access | Constructor and Description |
|---|---|
| public | OperatorBufferWithTime(long
the amount of time all chunks must be actively collect values before being emitted timespan, long the amount of time between creating chunks timeshift, TimeUnit the unit, int TimeUnit defining the unit of time for the timespanthe maximum size of the buffer. Once a buffer reaches this size, it is emitted count, Scheduler the scheduler)Scheduler to use for timing chunks
|
| Modifier and Type | Method and Description |
|---|---|
| public Subscriber |
| count | back to summary |
|---|---|
| pack-priv final int count | |
| scheduler | back to summary |
|---|---|
| pack-priv final Scheduler scheduler | |
| timeshift | back to summary |
|---|---|
| pack-priv final long timeshift | |
| timespan | back to summary |
|---|---|
| pack-priv final long timespan | |
| unit | back to summary |
|---|---|
| pack-priv final TimeUnit unit | |
| OperatorBufferWithTime | back to summary |
|---|---|
public OperatorBufferWithTime(long timespan, long timeshift, TimeUnit unit, int count, Scheduler scheduler)
| |
| call | back to summary |
|---|---|
| public Subscriber Implements rx.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Subscriber | |
| pack-priv List | chunk
Guarded by this. |
| pack-priv boolean | done
Guarded by this. |
| pack-priv final Scheduler. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| public void | onCompleted()
Implements rx. Observable has finished sending push-based notifications.
|
| public void | onError(Throwable
the exception encountered by the Observable e)Implements rx. Observable has experienced an error condition.
|
| public void | onNext(T
the item emitted by the Observable t)Implements rx. |
| pack-priv void |
| child | back to summary |
|---|---|
| pack-priv final Subscriber<? super List<T>> child | |
| chunk | back to summary |
|---|---|
| pack-priv List<T> chunk Guarded by this. | |
| done | back to summary |
|---|---|
| pack-priv boolean done Guarded by this. | |
| inner | back to summary |
|---|---|
| pack-priv final Scheduler. | |
| ExactSubscriber | back to summary |
|---|---|
| public ExactSubscriber(Subscriber<? super List<T>> child, Scheduler. | |
| emit | back to summary |
|---|---|
| pack-priv void emit() | |
| 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 e) Implements rx. Doc from rx. Notifies the Observer that the
If the | |
| onNext | back to summary |
|---|---|
| public void onNext(T t) Implements rx. Doc from rx. Provides the Observer with a new item to observe.
The
The
| |
| scheduleExact | back to summary |
|---|---|
| pack-priv void scheduleExact() | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Subscriber | |
| pack-priv final List | chunks
Guarded by this. |
| pack-priv boolean | done
Guarded by this. |
| pack-priv final Scheduler. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| public void | onCompleted()
Implements rx. Observable has finished sending push-based notifications.
|
| public void | onError(Throwable
the exception encountered by the Observable e)Implements rx. Observable has experienced an error condition.
|
| public void | onNext(T
the item emitted by the Observable t)Implements rx. |
| pack-priv void | |
| pack-priv void |
| child | back to summary |
|---|---|
| pack-priv final Subscriber<? super List<T>> child | |
| chunks | back to summary |
|---|---|
| pack-priv final List<List<T>> chunks Guarded by this. | |
| done | back to summary |
|---|---|
| pack-priv boolean done Guarded by this. | |
| inner | back to summary |
|---|---|
| pack-priv final Scheduler. | |
| InexactSubscriber | back to summary |
|---|---|
| public InexactSubscriber(Subscriber<? super List<T>> child, Scheduler. | |
| emitChunk | back to summary |
|---|---|
| pack-priv void emitChunk(List<T> chunkToEmit) | |
| 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 e) Implements rx. Doc from rx. Notifies the Observer that the
If the | |
| onNext | back to summary |
|---|---|
| public void onNext(T t) Implements rx. Doc from rx. Provides the Observer with a new item to observe.
The
The
| |
| scheduleChunk | back to summary |
|---|---|
| pack-priv void scheduleChunk() | |
| startNewChunk | back to summary |
|---|---|
| pack-priv void startNewChunk() | |