Class BufferTime
Represents an operator that projects each element of the sequence into zero or more buffers based on timing information.
The BufferTime operator groups the notifications of the source sequence into chunks, where each chunk contains the elements emitted during the specified TimeSpan. The overlap between the elements in each chunk can be controlled using the TimeShift property.
If no TimeShift is provided, the chunks will be strictly non-overlapping, with a new chunk beginning when the previous chunk ends. If TimeShift is smaller than TimeSpan, chunks 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 chunk where elements from the source sequence may be dropped.
[Combinator]
public class BufferTime
- Inheritance
-
BufferTime
- Inherited Members
Properties
TimeShift
Gets or sets the interval between creation of consecutive buffers.
public TimeSpan? TimeShift { get; set; }
Property Value
Remarks
If no value is specified, the operator will generate consecutive non-overlapping buffers.
TimeSpan
Gets or sets the length of each buffer.
public TimeSpan TimeSpan { get; set; }
Property Value
Methods
Process<TSource>(IObservable<TSource>)
Projects each element of an observable sequence into zero or more buffers based on timing information.
public IObservable<IList<TSource>> Process<TSource>(IObservable<TSource> source)
Parameters
sourceIObservable<TSource>The source sequence to produce buffers over.
Returns
- IObservable<IList<TSource>>
An observable sequence of buffers.
Type Parameters
TSourceThe type of the elements in the
sourcesequence.