Table of Contents

Class WindowTime

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 timing information.

Marble diagram

The WindowTime operator groups the notifications of the source sequence into new observable sequences, where each window contains the elements emitted during the specified TimeSpan. The overlap between the elements in each window can be controlled using the TimeShift property.

If no TimeShift is provided, the windows will be strictly non-overlapping, with a new window beginning when the previous window ends. If TimeShift is smaller than TimeSpan, windows will be overlapping, with a new buffer created every TimeShift interval. Finally, if TimeShift is larger than TimeSpan, there will be a time gap between each window where elements from the source sequence may 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 WindowTime : WindowCombinator
Inheritance
WindowTime
Inherited Members

Properties

TimeShift

Gets or sets the interval between creation of consecutive windows.

public TimeSpan? TimeShift { get; set; }

Property Value

TimeSpan?

Remarks

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

TimeSpan

Gets or sets the length of each window.

public TimeSpan TimeSpan { get; set; }

Property Value

TimeSpan

Methods

Process<TSource>(IObservable<TSource>)

Projects each element of an observable sequence into zero or more windows based on timing 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.