Class OperatorBufferWithStartEndObservable<T,​TOpening,​TClosing>

  • Type Parameters:
    T - the buffered value type
    TOpening - the value type of the Observable opening buffers
    TClosing - the value type of the Observable closing buffers
    All Implemented Interfaces:
    Func1<Subscriber<? super java.util.List<T>>,​Subscriber<? super T>>, Function, Observable.Operator<java.util.List<T>,​T>

    public final class OperatorBufferWithStartEndObservable<T,​TOpening,​TClosing>
    extends java.lang.Object
    implements Observable.Operator<java.util.List<T>,​T>
    This operation takes values from the specified Observable source and stores them in the currently active chunks. Initially there are no chunks active.

    Chunks can be created by pushing a TOpening value to the "bufferOpenings" Observable. This creates a new buffer which will then start recording values which are produced by the "source" Observable. Additionally the "bufferClosingSelector" will be used to construct an Observable which can produce values. When it does so it will close this (and only this) newly created buffer. When the source Observable completes or produces an error, all chunks are emitted, and the event is propagated to all subscribed Observers.

    Note that when using this operation multiple overlapping chunks could be active at any one point.