Method RegisterTimeOfDay
- Namespace
- KZDev.SystemClock.PrimeTime
- Assembly
- KZDev.SystemClock.PrimeTime.dll
RegisterTimeOfDay(LocalTimeOfDay, Action<ClockTimerCallbackContext>, CancellationToken, object?, DayTimeTimerOptions?)
Registers a local time-of-day timer with a synchronous callback that receives timer context and optional state.
Other RegisterTimeOfDay overloads for LocalTimeOfDay are provided as extension methods.
IClockDayTimeTimer RegisterTimeOfDay(LocalTimeOfDay timeOfDay, Action<ClockTimerCallbackContext> callback, CancellationToken cancellationToken, object? state = null, DayTimeTimerOptions? timerOptions = null)
Parameters
timeOfDayLocalTimeOfDayThe local time of day at which to fire.
callbackAction<ClockTimerCallbackContext>The callback invoked when the timer fires; receives timer context.
cancellationTokenCancellationTokenToken that participates in cancelling the timer registration; pass 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.
RegisterTimeOfDay(UtcTimeOfDay, Action<ClockTimerCallbackContext>, CancellationToken, object?, DayTimeTimerOptions?)
Registers a UTC time-of-day timer with a synchronous callback that receives timer context and optional state.
Other RegisterTimeOfDay overloads for UtcTimeOfDay are provided as extension methods.
IClockDayTimeTimer RegisterTimeOfDay(UtcTimeOfDay timeOfDay, Action<ClockTimerCallbackContext> callback, CancellationToken cancellationToken, object? state = null, DayTimeTimerOptions? timerOptions = null)
Parameters
timeOfDayUtcTimeOfDayThe UTC time of day at which to fire.
callbackAction<ClockTimerCallbackContext>The callback invoked when the timer fires; receives timer context.
cancellationTokenCancellationTokenToken that participates in cancelling the timer registration; pass 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.