Package rx.internal.operators
Class OperatorBufferWithStartEndObservable<T,TOpening,TClosing>
java.lang.Object
rx.internal.operators.OperatorBufferWithStartEndObservable<T,TOpening,TClosing>
- Type Parameters:
T
- the buffered value typeTOpening
- the value type of the Observable opening buffersTClosing
- the value type of the Observable closing buffers
- 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 Observer
s.
Note that when using this operation multiple overlapping chunks could be active at any one point.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) final class
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final Func1
<? super TOpening, ? extends Observable<? extends TClosing>> (package private) final Observable
<? extends TOpening> -
Constructor Summary
ConstructorsConstructorDescriptionOperatorBufferWithStartEndObservable
(Observable<? extends TOpening> bufferOpenings, Func1<? super TOpening, ? extends Observable<? extends TClosing>> bufferClosingSelector) -
Method Summary
-
Field Details
-
bufferOpening
-
bufferClosing
-
-
Constructor Details
-
OperatorBufferWithStartEndObservable
public OperatorBufferWithStartEndObservable(Observable<? extends TOpening> bufferOpenings, Func1<? super TOpening, ? extends Observable<? extends TClosing>> bufferClosingSelector) - Parameters:
bufferOpenings
- anObservable
which when it produces aTOpening
value will create a new buffer which instantly starts recording the "source"Observable
bufferClosingSelector
- aFunc1
object which producesObservable
s. TheseObservable
s determine when a buffer is emitted and replaced by simply producing an object.
-
-
Method Details