Skip to content

,System.TimeSpan)} ,System.TimeSpan,System.TimeProvider)}

ObservableAsync.Throttle(IObservableAsync, TimeSpan) method

Defined in

Type: ObservableAsync Namespace: ReactiveUI.Extensions.Async Assembly: ReactiveUI.Extensions.dll

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481

Overloads

  • 1. public static IObservableAsync<T> Throttle<T>(this IObservableAsync<T> @this, TimeSpan dueTime)
  • 2. public static IObservableAsync<T> Throttle<T>(this IObservableAsync<T> @this, TimeSpan dueTime, TimeProvider? timeProvider)

1. Overload

public static IObservableAsync<T> Throttle<T>(this IObservableAsync<T> @this, TimeSpan dueTime)

View source

Summary: Ignores elements from the source sequence that are followed by another element within the specified time span. Only the last element in each burst is forwarded.

Type parameters

NameDescription
TThe type of elements in the source sequence.

Parameters

NameTypeDescription
this[IObservableAsync](#The source observable sequence.
dueTimeTimeSpanThe time span that must elapse after the last element before it is forwarded. Must be non-negative.

Returns: IObservableAsync -- An observable sequence containing only those elements that are not followed by another element within the specified due time.

Exceptions

TypeCondition
System.ArgumentOutOfRangeExceptionThrown if dueTime is negative.

2. Overload

public static IObservableAsync<T> Throttle<T>(this IObservableAsync<T> @this, TimeSpan dueTime, TimeProvider? timeProvider)

View source

Summary: Ignores elements from the source sequence that are followed by another element within the specified time span. Only the last element in each burst is forwarded.

Type parameters

NameDescription
TThe type of elements in the source sequence.

Parameters

NameTypeDescription
this[IObservableAsync](#The source observable sequence.
dueTimeTimeSpanThe time span that must elapse after the last element before it is forwarded. Must be non-negative.
timeProviderTimeProvider?An optional time provider for controlling timing. If null, System is used.

Returns: IObservableAsync -- An observable sequence containing only those elements that are not followed by another element within the specified due time.

Exceptions

TypeCondition
System.ArgumentOutOfRangeExceptionThrown if dueTime is negative.