Skip to content

,System.Int32)} ,System.TimeSpan)} ,System.TimeSpan,System.Reactive.Concurrency.IScheduler)}

Observable.TakeLastBuffer(IObservable, int) method

Defined in

Type: Observable Namespace: System.Reactive.Linq Assembly: System.Reactive.dll

Applies to

netstandard2.0

Overloads

  • 1. public static IObservable<IList<TSource>> TakeLastBuffer<TSource>(this IObservable<TSource> source, int count)
  • 2. public static IObservable<IList<TSource>> TakeLastBuffer<TSource>(this IObservable<TSource> source, TimeSpan duration)
  • 3. public static IObservable<IList<TSource>> TakeLastBuffer<TSource>(this IObservable<TSource> source, TimeSpan duration, IScheduler scheduler)

1. Overload

public static IObservable<IList<TSource>> TakeLastBuffer<TSource>(this IObservable<TSource> source, int count)

Summary: Returns a list with the specified number of contiguous elements from the end of an observable sequence.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence.
countintNumber of elements to take from the end of the source sequence.

Returns: IObservable> -- An observable sequence containing a single list with the specified number of elements from the end of the source sequence.

Remarks

This operator accumulates a buffer with a length enough to store count elements. Upon completion of the source sequence, this buffer is produced on the result sequence.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.
System.ArgumentOutOfRangeExceptioncount is less than zero.

2. Overload

public static IObservable<IList<TSource>> TakeLastBuffer<TSource>(this IObservable<TSource> source, TimeSpan duration)

Summary: Returns a list with the elements within the specified duration from the end of the observable source sequence.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence to take elements from.
durationTimeSpanDuration for taking elements from the end of the sequence.

Returns: IObservable> -- An observable sequence containing a single list with the elements taken during the specified duration from the end of the source sequence.

Remarks

This operator accumulates a buffer with a length enough to store elements for any duration window during the lifetime of the source sequence. Upon completion of the source sequence, this buffer is produced on the result sequence.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.
System.ArgumentOutOfRangeExceptionduration is less than TimeSpan.Zero.

3. Overload

public static IObservable<IList<TSource>> TakeLastBuffer<TSource>(this IObservable<TSource> source, TimeSpan duration, IScheduler scheduler)

Summary: Returns a list with the elements within the specified duration from the end of the observable source sequence, using the specified scheduler to run timers.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence to take elements from.
durationTimeSpanDuration for taking elements from the end of the sequence.
scheduler[IScheduler](#Scheduler to run the timer on.

Returns: IObservable> -- An observable sequence containing a single list with the elements taken during the specified duration from the end of the source sequence.

Remarks

This operator accumulates a buffer with a length enough to store elements for any duration window during the lifetime of the source sequence. Upon completion of the source sequence, this buffer is produced on the result sequence.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or scheduler is null.
System.ArgumentOutOfRangeExceptionduration is less than TimeSpan.Zero.