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 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 specifiedObservable
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 anObservable
which can produce values. When it does so it will close this (and only this) newly created buffer. When the sourceObservable
completes or produces an error, all chunks are emitted, and the event is propagated to all subscribedObserver
s.Note that when using this operation multiple overlapping chunks could be active at any one point.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
OperatorBufferWithStartEndObservable.BufferingSubscriber
-
Field Summary
Fields Modifier and Type Field Description (package private) Func1<? super TOpening,? extends Observable<? extends TClosing>>
bufferClosing
(package private) Observable<? extends TOpening>
bufferOpening
-
Constructor Summary
Constructors Constructor Description OperatorBufferWithStartEndObservable(Observable<? extends TOpening> bufferOpenings, Func1<? super TOpening,? extends Observable<? extends TClosing>> bufferClosingSelector)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Subscriber<? super T>
call(Subscriber<? super java.util.List<T>> child)
-
-
-
Field Detail
-
bufferOpening
final Observable<? extends TOpening> bufferOpening
-
bufferClosing
final Func1<? super TOpening,? extends Observable<? extends TClosing>> bufferClosing
-
-
Constructor Detail
-
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 Detail
-
call
public Subscriber<? super T> call(Subscriber<? super java.util.List<T>> child)
-
-