Table of Contents

Method RegisterAsyncTimeOfDay

Namespace
KZDev.PrimeTime
Assembly
KZDev.PrimeTime.dll

RegisterAsyncTimeOfDay(IPrimeClock, LocalTime, Func<CancellationToken, ValueTask>, CancellationToken, DayTimeTimerOptions?)

Registers a time-of-day timer with an asynchronous callback.

public static IClockDayTimeTimer RegisterAsyncTimeOfDay(this IPrimeClock clock, LocalTime timeOfDay, Func<CancellationToken, ValueTask> callback, CancellationToken cancellationToken, DayTimeTimerOptions? timerOptions = null)

Parameters

clock IPrimeClock
timeOfDay LocalTime

The local time of day at which to fire.

callback Func<CancellationToken, ValueTask>

The async callback (returns ValueTask).

cancellationToken CancellationToken

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

timerOptions DayTimeTimerOptions

Optional day-time timer options.

Returns

IClockDayTimeTimer

An IClockDayTimeTimer to monitor or change the timer.

RegisterAsyncTimeOfDay(IPrimeClock, LocalTimeOfDay, Func<ClockTimerCallbackContext, CancellationToken, ValueTask>, CancellationToken, object?, DayTimeTimerOptions?)

Registers a time-of-day timer with an asynchronous callback that receives context and cancellation token, using BCL LocalTimeOfDay.

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

Parameters

clock IPrimeClock
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(IPrimeClock, LocalTimeOfDay, Func<CancellationToken, ValueTask>, CancellationToken, DayTimeTimerOptions?)

Registers a time-of-day timer with an asynchronous callback, using BCL LocalTimeOfDay.

public static IClockDayTimeTimer RegisterAsyncTimeOfDay(this IPrimeClock clock, LocalTimeOfDay timeOfDay, Func<CancellationToken, ValueTask> callback, CancellationToken cancellationToken, DayTimeTimerOptions? timerOptions = null)

Parameters

clock IPrimeClock
timeOfDay LocalTimeOfDay

The local time of day at which to fire.

callback Func<CancellationToken, ValueTask>

The async callback (returns ValueTask).

cancellationToken CancellationToken

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

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.