Method RegisterAsyncTimeOfDay
RegisterAsyncTimeOfDay(IPrimeClock, LocalTimeOfDay, Func<CancellationToken, ValueTask>, CancellationToken, DayTimeTimerOptions?)
Registers a time-of-day timer with an asynchronous callback.
public static IClockDayTimeTimer RegisterAsyncTimeOfDay(this IPrimeClock clock, LocalTimeOfDay timeOfDay, Func<CancellationToken, ValueTask> callback, CancellationToken cancellationToken, DayTimeTimerOptions? timerOptions = null)
Parameters
clockIPrimeClocktimeOfDayLocalTimeOfDayThe local time of day at which to fire.
callbackFunc<CancellationToken, ValueTask>The async callback (returns ValueTask).
cancellationTokenCancellationTokenToken that participates in cancelling the timer registration and is passed to the callback; use None when no external cancellation is required.
timerOptionsDayTimeTimerOptionsOptional day-time timer options.
Returns
- IClockDayTimeTimer
An IClockDayTimeTimer to monitor or change the timer.
Remarks
Only supported in .NET 8+. Not supported in NetStandard 2.0.
RegisterAsyncTimeOfDay(IPrimeClock, UtcTimeOfDay, Func<CancellationToken, ValueTask>, CancellationToken, DayTimeTimerOptions?)
Registers a UTC time-of-day timer with an asynchronous callback.
public static IClockDayTimeTimer RegisterAsyncTimeOfDay(this IPrimeClock clock, UtcTimeOfDay timeOfDay, Func<CancellationToken, ValueTask> callback, CancellationToken cancellationToken, DayTimeTimerOptions? timerOptions = null)
Parameters
clockIPrimeClocktimeOfDayUtcTimeOfDayThe UTC time of day at which to fire.
callbackFunc<CancellationToken, ValueTask>The async callback (returns ValueTask).
cancellationTokenCancellationTokenToken that participates in cancelling the timer registration and is passed to the callback; use None when no external cancellation is required.
timerOptionsDayTimeTimerOptionsOptional day-time timer options.
Returns
- IClockDayTimeTimer
An IClockDayTimeTimer to monitor or change the timer.
Remarks
Only supported in .NET 8+. Not supported in NetStandard 2.0.