Table of Contents

Method RegisterAsyncTimeOfDay

Namespace
KZDev.PrimeTime
Assembly
KZDev.PrimeTime.dll

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

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.

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

clock IPrimeClock
timeOfDay UtcTimeOfDay

The UTC 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.