Table of Contents

Class WindowCount

Namespace
Bonsai.Reactive
Assembly
Bonsai.Core.dll

Represents an operator that projects each element of an observable sequence into zero or more windows based on element count information.

Marble diagram

WindowCount groups the notifications of the source sequence into new observable sequences containing the number of elements specified in the Count property. The overlap between the elements in each window can be controlled using the Skip property.

If no skip value is provided, the windows will be strictly non-overlapping, with a new window beginning when the previous window ends. If the skip value is less than the specified number of elements, windows will be overlapping, with a new window created every Skip notifications. Finally, if the skip value is greater than the specified number of elements, there will be a gap between each window where elements from the source sequence will be dropped.

Note

You can manipulate and schedule each of the windows downstream using other higher-order operators such as Merge, Concat or Switch.

public class WindowCount : WindowCombinator
Inheritance
WindowCount
Inherited Members

Properties

Count

Gets or sets the maximum number of elements in each window.

public int Count { get; set; }

Property Value

int

Skip

Gets or sets the number of elements to skip between the creation of consecutive windows.

public int? Skip { get; set; }

Property Value

int?

Remarks

If no value is specified, the operator will generate consecutive non-overlapping windows.

Methods

Process<TSource>(IObservable<TSource>)

Projects each element of an observable sequence into zero or more windows based on element count information.

public override IObservable<IObservable<TSource>> Process<TSource>(IObservable<TSource> source)

Parameters

source IObservable<TSource>

The source sequence to produce windows over.

Returns

IObservable<IObservable<TSource>>

An observable sequence of windows.

Type Parameters

TSource

The type of the elements in the source sequence.