RxJava



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

java.lang.Object
  extended by rx.operators.ChunkedOperation.Chunks<T,C>
      extended by rx.operators.ChunkedOperation.TimeAndSizeBasedChunks<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.TimeAndSizeBasedChunks<T,C>
extends ChunkedOperation.Chunks<T,C>

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


Constructor Summary
ChunkedOperation.TimeAndSizeBasedChunks(Observer<? super C> observer, Func0<? extends ChunkedOperation.Chunk<T,C>> chunkMaker, int maxSize, long maxTime, 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.
 void pushValue(T value)
          This method pushes a value to all not yet emitted ChunkedOperation.Chunk objects.
 
Methods inherited from class rx.operators.ChunkedOperation.Chunks
emitAllChunks, getChunk
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChunkedOperation.TimeAndSizeBasedChunks

public ChunkedOperation.TimeAndSizeBasedChunks(Observer<? super C> observer,
                                               Func0<? extends ChunkedOperation.Chunk<T,C>> chunkMaker,
                                               int maxSize,
                                               long maxTime,
                                               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.

pushValue

public void pushValue(T value)
Description copied from class: ChunkedOperation.Chunks
This method pushes a value to all not yet emitted ChunkedOperation.Chunk objects.

Overrides:
pushValue in class ChunkedOperation.Chunks<T,C>
Parameters:
value - The value to push to all not yet emitted ChunkedOperation.Chunk objects.