Class OperatorBufferWithStartEndObservable<T,TOpening,TClosing>

  • Type Parameters:
    T - the buffered value type
    All Implemented Interfaces:
    Func1<Subscriber<? super List<T>>,Subscriber<? super T>>, Function, Observable.Operator<List<T>,T>


    public final class OperatorBufferWithStartEndObservable<T,TOpening,TClosing>
    extends Object
    implements Observable.Operator<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.

    • Constructor Detail

      • OperatorBufferWithStartEndObservable

        public OperatorBufferWithStartEndObservable(Observable<? extends TOpening> bufferOpenings,
                                                    Func1<? super TOpening,? extends Observable<? extends TClosing>> bufferClosingSelector)
        Parameters:
        bufferOpenings - an Observable which when it produces a TOpening value will create a new buffer which instantly starts recording the "source" Observable
        bufferClosingSelector - a Func1 object which produces Observables. These Observables determine when a buffer is emitted and replaced by simply producing an object.