ObservableAsync.Interval(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<long> Interval(TimeSpan period) - 2.
public static IObservableAsync<long> Interval(TimeSpan period, TimeProvider? timeProvider)
1. Overload¶
public static IObservableAsync<long> Interval(TimeSpan period)
Summary: Creates an asynchronous observable sequence that emits a long integer value at each specified time interval.
Parameters
| Name | Type | Description |
|---|---|---|
period | TimeSpan | The time interval between emissions of values. Must be a positive duration. |
Returns: IObservableAsync
Remarks
The sequence continues emitting values until the observer unsubscribes or the cancellation token is triggered. This method is useful for generating periodic events or timers in asynchronous workflows.
2. Overload¶
public static IObservableAsync<long> Interval(TimeSpan period, TimeProvider? timeProvider)
Summary: Creates an asynchronous observable sequence that emits a long integer value at each specified time interval.
Parameters
| Name | Type | Description |
|---|---|---|
period | TimeSpan | The time interval between emissions of values. Must be a positive duration. |
timeProvider | TimeProvider? | An optional time provider used to control the timing of emissions. If null or set to TimeProvider.System, the system clock is used. |
Returns: IObservableAsync
Remarks
The sequence continues emitting values until the observer unsubscribes or the cancellation token is triggered. This method is useful for generating periodic events or timers in asynchronous workflows.