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 List<T>>,
,Subscriber<? super T>> Function
,Observable.Operator<List<T>,
T>
public final class OperatorBufferWithSingleObservable<T,TClosing>
extends Object
implements Observable.Operator<List<T>,T>
This operation takes
values from the specified
Observable
source and stores them in a buffer until the
Observable
constructed using the Func0
argument, produces a value. The buffer is then
emitted, and a new buffer is created to replace it. A new Observable
will be constructed using
the provided Func0
object, which will determine when this new buffer is emitted. When the source
Observable
completes or produces an error, the current buffer is emitted, and the event is
propagated to all subscribed Observer
s.
Note that this operation only produces non-overlapping chunks. At all times there is exactly one buffer actively storing values.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) final class
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final Func0
<? extends Observable<? extends TClosing>> (package private) final int
-
Constructor Summary
ConstructorsConstructorDescriptionOperatorBufferWithSingleObservable
(Func0<? extends Observable<? extends TClosing>> bufferClosingSelector, int initialCapacity) OperatorBufferWithSingleObservable
(Observable<? extends TClosing> bufferClosing, int initialCapacity) -
Method Summary
-
Field Details
-
bufferClosingSelector
-
initialCapacity
final int initialCapacity
-
-
Constructor Details
-
OperatorBufferWithSingleObservable
public OperatorBufferWithSingleObservable(Func0<? extends Observable<? extends TClosing>> bufferClosingSelector, int initialCapacity) - Parameters:
bufferClosingSelector
- aFunc0
object which producesObservable
s. TheseObservable
s 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
- AnObservable
to determine when a buffer is emitted and replaced by simply producing an object.initialCapacity
- the initial capacity of each buffer
-
-
Method Details