Class BufferOperator
The buffer operator.
public static class BufferOperator
- Inheritance
-
System.ObjectBufferOperator
Methods
Buffer<T, TNotifier>(Observable<T>, Observable<TNotifier>)
Buffers source's values into an array, emitted each time closingNotifier
emits, then starts a new, empty buffer. Mirrors rxjs's buffer. Same boundary-observable idea as
Window<T, TBoundary>(Observable<T>, Observable<TBoundary>), but collecting into arrays instead of live windows:
closingNotifier is subscribed exactly once, for the whole lifetime of the output.
If source completes while a buffer is still open (regardless of whether it has any
values), that buffer is emitted before completion is forwarded.
public static Observable<IReadOnlyList<T>> Buffer<T, TNotifier>(this Observable<T> source, Observable<TNotifier> closingNotifier)
Parameters
sourceObservable<T>The source observable to buffer.
closingNotifierObservable<TNotifier>Each emission closes the current buffer (emitting it) and opens a new one.
Returns
- Observable<IReadOnlyList<T>>
An observable of each completed (or trailing) buffer as an IReadOnlyList<T>.
Type Parameters
TThe type of the elements collected into each buffer.
TNotifierThe (unused) element type of
closingNotifier.