PeriodicTimer Module
Periodic background timer — runs an action at fixed intervals with cancellation.
Functions and values
| Function or value |
Description
|
Full Usage:
PeriodicTimer.start interval action ct onError
Parameters:
TimeSpan
action : unit -> Task<unit>
ct : CancellationToken
onError : exn -> unit
Returns: Task
|
Starts a background loop that runs action every interval. The delay between each tick. The async action to execute on each tick. The cancellation token to stop the loop. Handler invoked when the action throws a non-cancellation exception.
|
Full Usage:
PeriodicTimer.startCounted interval action ct onError
Parameters:
TimeSpan
action : int -> Task<unit>
ct : CancellationToken
onError : exn -> unit
Returns: Task
|
Like start, but action receives a counter (0-based) for each tick. The delay between each tick. The async action to execute, receiving the current tick index. The cancellation token to stop the loop. Handler invoked when the action throws a non-cancellation exception.
|
TDesu.FSharp