Skip to content

)}

WasmScheduler.SchedulePeriodic(TState, TimeSpan, Func) method

Defined in

Type: WasmScheduler Namespace: System.Reactive.Concurrency Assembly: System.Reactive.Wasm.dll

Applies to

netstandard2.0

public IDisposable SchedulePeriodic<TState>(TState state, TimeSpan period, Func<TState, TState> action)

View source (opens in a new tab)

Summary: Schedules a periodic piece of work, using a Windows.System.Threading.ThreadPoolTimer object.

Type parameters

NameDescription
TStateThe type of the state passed to the scheduled action.

Parameters

NameTypeDescription
stateTStateInitial state passed to the action upon the first iteration.
periodTimeSpan (opens in a new tab)Period for running the work periodically.
actionFunc (opens in a new tab)Action to be executed, potentially updating the state.

Returns: IDisposable (opens in a new tab) -- The disposable object used to cancel the scheduled recurring action (best effort).

Exceptions

TypeCondition
System.ArgumentNullException (opens in a new tab)action is null.
System.ArgumentOutOfRangeException (opens in a new tab)period is less than one millisecond.