Package rx.internal.operators
Class OperatorBufferWithSingleObservable<T,TClosing>
- java.lang.Object
-
- rx.internal.operators.OperatorBufferWithSingleObservable<T,TClosing>
-
- Type Parameters:
T- the buffered value typeTClosing- the value type of the Observable signaling the end of each buffer
- All Implemented Interfaces:
Func1<Subscriber<? super java.util.List<T>>,Subscriber<? super T>>,Function,Observable.Operator<java.util.List<T>,T>
public final class OperatorBufferWithSingleObservable<T,TClosing> extends java.lang.Object implements Observable.Operator<java.util.List<T>,T>
This operation takes values from the specifiedObservablesource and stores them in a buffer until theObservableconstructed using theFunc0argument, produces a value. The buffer is then emitted, and a new buffer is created to replace it. A newObservablewill be constructed using the providedFunc0object, which will determine when this new buffer is emitted. When the sourceObservablecompletes or produces an error, the current buffer is emitted, and the event is propagated to all subscribedObservers.Note that this operation only produces non-overlapping chunks. At all times there is exactly one buffer actively storing values.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classOperatorBufferWithSingleObservable.BufferingSubscriber
-
Field Summary
Fields Modifier and Type Field Description (package private) Func0<? extends Observable<? extends TClosing>>bufferClosingSelector(package private) intinitialCapacity
-
Constructor Summary
Constructors Constructor Description OperatorBufferWithSingleObservable(Func0<? extends Observable<? extends TClosing>> bufferClosingSelector, int initialCapacity)OperatorBufferWithSingleObservable(Observable<? extends TClosing> bufferClosing, int initialCapacity)
-
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
-
bufferClosingSelector
final Func0<? extends Observable<? extends TClosing>> bufferClosingSelector
-
initialCapacity
final int initialCapacity
-
-
Constructor Detail
-
OperatorBufferWithSingleObservable
public OperatorBufferWithSingleObservable(Func0<? extends Observable<? extends TClosing>> bufferClosingSelector, int initialCapacity)
- Parameters:
bufferClosingSelector- aFunc0object which producesObservables. TheseObservables determine when a buffer is emitted and replaced by simply producing an object.initialCapacity- the initial capacity of each buffer
-
OperatorBufferWithSingleObservable
public OperatorBufferWithSingleObservable(Observable<? extends TClosing> bufferClosing, int initialCapacity)
- Parameters:
bufferClosing- AnObservableto determine when a buffer is emitted and replaced by simply producing an object.initialCapacity- the initial capacity of each buffer
-
-
Method Detail
-
call
public Subscriber<? super T> call(Subscriber<? super java.util.List<T>> child)
-
-