Class WindowTime
Represents an operator that projects each element of an observable sequence into zero or more windows based on timing information.
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
.
Example
Use WindowTime
to group elements into zero or more observable sequences based on timing information.
Alternatives
Use WindowCount
instead to create new observable sequences based on element count.
Use BufferTime
instead to group elements into zero or more buffers based on timing information.
public class WindowTime : WindowCombinator
- Inheritance
-
WindowTime
- Inherited Members
Properties
- TimeShift
Gets or sets the interval between creation of consecutive windows.
- TimeSpan
Gets or sets the length of each window.
Methods
- Process<TSource>(IObservable<TSource>)
Projects each element of an observable sequence into zero or more windows based on timing information.