Skip to content

,System.TimeSpan)} ,System.TimeSpan,System.TimeProvider)} ,System.TimeSpan,ReactiveUI.Extensions.Async.IObservableAsync{--0})} ,System.TimeSpan,ReactiveUI.Extensions.Async.IObservableAsync{--0},System.TimeProvider)}

ObservableAsync.Timeout(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> Timeout<T>(this IObservableAsync<T> @this, TimeSpan dueTime)
  • 2. public static IObservableAsync<T> Timeout<T>(this IObservableAsync<T> @this, TimeSpan dueTime, TimeProvider? timeProvider)
  • 3. public static IObservableAsync<T> Timeout<T>(this IObservableAsync<T> @this, TimeSpan dueTime, IObservableAsync<T> fallback)
  • 4. public static IObservableAsync<T> Timeout<T>(this IObservableAsync<T> @this, TimeSpan dueTime, IObservableAsync<T> fallback, TimeProvider? timeProvider)

1. Overload

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

View source

Summary: Applies a dueTime policy to the observable sequence. If the next element is not received within the specified time span, the sequence completes with a TimeoutException.

Type parameters

NameDescription
TThe type of elements in the sequence.

Parameters

NameTypeDescription
this[IObservableAsync](#The source observable sequence.
dueTimeTimeSpanThe maximum time span allowed between consecutive elements. Must be positive.

Returns: IObservableAsync -- An observable sequence that mirrors the source but completes with a TimeoutException if any inter-element interval exceeds the specified dueTime.

Exceptions

TypeCondition
System.ArgumentOutOfRangeExceptionThrown if dueTime is negative or zero.

2. Overload

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

View source

Summary: Applies a dueTime policy to the observable sequence. If the next element is not received within the specified time span, the sequence completes with a TimeoutException.

Type parameters

NameDescription
TThe type of elements in the sequence.

Parameters

NameTypeDescription
this[IObservableAsync](#The source observable sequence.
dueTimeTimeSpanThe maximum time span allowed between consecutive elements. Must be positive.
timeProviderTimeProvider?An optional time provider for controlling timing. If null, System is used.

Returns: IObservableAsync -- An observable sequence that mirrors the source but completes with a TimeoutException if any inter-element interval exceeds the specified dueTime.

Exceptions

TypeCondition
System.ArgumentOutOfRangeExceptionThrown if dueTime is negative or zero.

3. Overload

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

View source

Summary: Applies a dueTime policy to the observable sequence. If the next element is not received within the specified time span, the sequence switches to the specified fallback observable.

Type parameters

NameDescription
TThe type of elements in the sequence.

Parameters

NameTypeDescription
this[IObservableAsync](#The source observable sequence.
dueTimeTimeSpanThe maximum time span allowed between consecutive elements. Must be positive.
fallback[IObservableAsync](#The fallback observable to switch to when a dueTime occurs. Cannot be null.

Returns: IObservableAsync -- An observable sequence that mirrors the source, switching to the fallback sequence if any inter-element interval exceeds the specified dueTime.

Exceptions

TypeCondition
System.ArgumentOutOfRangeExceptionThrown if dueTime is negative or zero.
System.ArgumentNullExceptionThrown if fallback is null.

4. Overload

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

View source

Summary: Applies a dueTime policy to the observable sequence. If the next element is not received within the specified time span, the sequence switches to the specified fallback observable.

Type parameters

NameDescription
TThe type of elements in the sequence.

Parameters

NameTypeDescription
this[IObservableAsync](#The source observable sequence.
dueTimeTimeSpanThe maximum time span allowed between consecutive elements. Must be positive.
fallback[IObservableAsync](#The fallback observable to switch to when a dueTime occurs. Cannot be null.
timeProviderTimeProvider?An optional time provider for controlling timing. If null, System is used.

Returns: IObservableAsync -- An observable sequence that mirrors the source, switching to the fallback sequence if any inter-element interval exceeds the specified dueTime.

Exceptions

TypeCondition
System.ArgumentOutOfRangeExceptionThrown if dueTime is negative or zero.
System.ArgumentNullExceptionThrown if fallback is null.