Method RegisterAsyncTimeOfDay
RegisterAsyncTimeOfDay(LocalTime, Func<ClockTimerCallbackContext, CancellationToken, ValueTask>, CancellationToken, object?, DayTimeTimerOptions?)
Registers a time-of-day timer with an asynchronous callback that receives context and cancellation token.
Other NodaTime.LocalTime RegisterAsyncTimeOfDay overloads are extension methods.
public IClockDayTimeTimer RegisterAsyncTimeOfDay(LocalTime timeOfDay, Func<ClockTimerCallbackContext, CancellationToken, ValueTask> callback, CancellationToken cancellationToken, object? state = null, DayTimeTimerOptions? timerOptions = null)
Parameters
timeOfDayLocalTimeThe local time of day at which to fire.
callbackFunc<ClockTimerCallbackContext, CancellationToken, ValueTask>The async callback; receives timer context and a cancellation token.
cancellationTokenCancellationTokenToken that participates in cancelling the timer registration and is passed to the callback; use None when no external cancellation is required.
stateobjectOptional state passed to the callback via ClockTimerCallbackContext.
timerOptionsDayTimeTimerOptionsOptional day-time timer options.
Returns
- IClockDayTimeTimer
An IClockDayTimeTimer to monitor or change the timer.
RegisterAsyncTimeOfDay(LocalTimeOfDay, Func<ClockTimerCallbackContext, CancellationToken, ValueTask>, CancellationToken, object?, DayTimeTimerOptions?)
Registers a local time-of-day timer with an asynchronous callback that receives timer context and cancellation token.
Other RegisterAsyncTimeOfDay overloads for LocalTimeOfDay are provided as extension methods.
public IClockDayTimeTimer RegisterAsyncTimeOfDay(LocalTimeOfDay timeOfDay, Func<ClockTimerCallbackContext, CancellationToken, ValueTask> callback, CancellationToken cancellationToken, object? state = null, DayTimeTimerOptions? timerOptions = null)
Parameters
timeOfDayLocalTimeOfDayThe local time of day at which to fire.
callbackFunc<ClockTimerCallbackContext, CancellationToken, ValueTask>The async callback; receives timer context and a cancellation token.
cancellationTokenCancellationTokenToken that participates in cancelling the timer registration and is passed to the callback; use None when no external cancellation is required.
stateobjectOptional state passed to the callback via ClockTimerCallbackContext.
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(UtcTimeOfDay, Func<ClockTimerCallbackContext, CancellationToken, ValueTask>, CancellationToken, object?, DayTimeTimerOptions?)
Registers a UTC time-of-day timer with an asynchronous callback that receives timer context and cancellation token.
Other RegisterAsyncTimeOfDay overloads for UtcTimeOfDay are provided as extension methods.
public IClockDayTimeTimer RegisterAsyncTimeOfDay(UtcTimeOfDay timeOfDay, Func<ClockTimerCallbackContext, CancellationToken, ValueTask> callback, CancellationToken cancellationToken, object? state = null, DayTimeTimerOptions? timerOptions = null)
Parameters
timeOfDayUtcTimeOfDayThe UTC time of day at which to fire.
callbackFunc<ClockTimerCallbackContext, CancellationToken, ValueTask>The async callback; receives timer context and a cancellation token.
cancellationTokenCancellationTokenToken that participates in cancelling the timer registration and is passed to the callback; use None when no external cancellation is required.
stateobjectOptional state passed to the callback via ClockTimerCallbackContext.
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.