Class WindowCountOperator
The windowCount operator.
public static class WindowCountOperator
- Inheritance
-
System.ObjectWindowCountOperator
Methods
WindowCount<T>(Observable<T>, int, int?)
Like BufferCount<T>(Observable<T>, int, int?)'s overlapping-window algorithm, but emits live
Observable<T> windows (each backed by its own Subject<T>) instead of buffered
arrays. Ported directly from rxjs's own windowCount: the first window opens eagerly at subscription
time (so even an empty or immediately-erroring source still emits exactly one, empty, window), a new window
opens every startWindowEvery values (defaulting to windowSize, i.e.
non-overlapping windows), and the oldest still-open window completes once it has received
windowSize values — the two counters run independently, which is what produces
overlapping windows when startWindowEvery is less than windowSize.
public static Observable<Observable<T>> WindowCount<T>(this Observable<T> source, int windowSize, int? startWindowEvery = null)
Parameters
sourceObservable<T>The source observable.
windowSizeintThe number of values each window collects before closing.
startWindowEveryint?How often (in source values) a new window opens; defaults to
windowSizefor non-overlapping windows.
Returns
- Observable<Observable<T>>
An observable of windows, each itself an observable of up to
windowSizevalues.
Type Parameters
TThe element type of the source.