RxJava



rx.operators
Class ChunkedOperation.TimeBasedChunks<T,C>

java.lang.Object
  extended by rx.operators.ChunkedOperation.Chunks<T,C>
      extended by rx.operators.ChunkedOperation.OverlappingChunks<T,C>
          extended by rx.operators.ChunkedOperation.TimeBasedChunks<T,C>
Type Parameters:
T - The type of object all internal ChunkedOperation.Chunk objects record. The type of object being tracked by the ChunkedOperation.Chunk
Enclosing class:
ChunkedOperation

protected static class ChunkedOperation.TimeBasedChunks<T,C>
extends ChunkedOperation.OverlappingChunks<T,C>

This class is an extension on the ChunkedOperation.Chunks class. Every internal chunk has a has a maximum time to live. When the chunk has reached the end of its life it is automatically emitted.


Constructor Summary
ChunkedOperation.TimeBasedChunks(Observer<? super C> observer, Func0<? extends ChunkedOperation.Chunk<T,C>> chunkMaker, long time, java.util.concurrent.TimeUnit unit, Scheduler scheduler)
           
 
Method Summary
 ChunkedOperation.Chunk<T,C> createChunk()
          This method will instantiate a new ChunkedOperation.Chunk object and register it internally.
 void emitChunk(ChunkedOperation.Chunk<T,C> chunk)
          This method emits the specified ChunkedOperation.Chunk object.
 
Methods inherited from class rx.operators.ChunkedOperation.Chunks
emitAllChunks, getChunk, pushValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChunkedOperation.TimeBasedChunks

public ChunkedOperation.TimeBasedChunks(Observer<? super C> observer,
                                        Func0<? extends ChunkedOperation.Chunk<T,C>> chunkMaker,
                                        long time,
                                        java.util.concurrent.TimeUnit unit,
                                        Scheduler scheduler)
Method Detail

createChunk

public ChunkedOperation.Chunk<T,C> createChunk()
Description copied from class: ChunkedOperation.Chunks
This method will instantiate a new ChunkedOperation.Chunk object and register it internally.

Overrides:
createChunk in class ChunkedOperation.Chunks<T,C>
Returns:
The constructed empty ChunkedOperation.Chunk object.

emitChunk

public void emitChunk(ChunkedOperation.Chunk<T,C> chunk)
Description copied from class: ChunkedOperation.Chunks
This method emits the specified ChunkedOperation.Chunk object.

Overrides:
emitChunk in class ChunkedOperation.Chunks<T,C>
Parameters:
chunk - The ChunkedOperation.Chunk to emit.