Table of Contents

Method RegisterAsyncTimeOfDay

Namespace
KZDev.SystemClock.PrimeTime
Assembly
KZDev.SystemClock.PrimeTime.dll

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.

IClockDayTimeTimer RegisterAsyncTimeOfDay(LocalTimeOfDay timeOfDay, Func<ClockTimerCallbackContext, CancellationToken, ValueTask> callback, CancellationToken cancellationToken, object? state = null, DayTimeTimerOptions? timerOptions = null)

Parameters

timeOfDay LocalTimeOfDay

The local time of day at which to fire.

callback Func<ClockTimerCallbackContext, CancellationToken, ValueTask>

The async callback; receives timer context and a cancellation token.

cancellationToken CancellationToken

Token that participates in cancelling the timer registration and is passed to the callback; use None when no external cancellation is required.

state object

Optional state passed to the callback via ClockTimerCallbackContext.

timerOptions DayTimeTimerOptions

Optional 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.

IClockDayTimeTimer RegisterAsyncTimeOfDay(UtcTimeOfDay timeOfDay, Func<ClockTimerCallbackContext, CancellationToken, ValueTask> callback, CancellationToken cancellationToken, object? state = null, DayTimeTimerOptions? timerOptions = null)

Parameters

timeOfDay UtcTimeOfDay

The UTC time of day at which to fire.

callback Func<ClockTimerCallbackContext, CancellationToken, ValueTask>

The async callback; receives timer context and a cancellation token.

cancellationToken CancellationToken

Token that participates in cancelling the timer registration and is passed to the callback; use None when no external cancellation is required.

state object

Optional state passed to the callback via ClockTimerCallbackContext.

timerOptions DayTimeTimerOptions

Optional 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.