Table of Contents

Method RegisterTimeOfDay

Namespace
KZDev.PrimeTime
Assembly
KZDev.PrimeTime.dll

RegisterTimeOfDay(IPrimeClock, LocalTimeOfDay, Action<ClockTimerCallbackContext, CancellationToken>, CancellationToken, object?, DayTimeTimerOptions?)

Registers a time-of-day timer with a callback that receives context and cancellation token.

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

Parameters

clock IPrimeClock
timeOfDay LocalTimeOfDay

The local time of day at which to fire.

callback Action<ClockTimerCallbackContext, CancellationToken>

The callback invoked when the timer fires; receives timer context and a cancellation token.

cancellationToken CancellationToken

Token that participates in cancelling the timer registration; pass 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.

RegisterTimeOfDay(IPrimeClock, LocalTimeOfDay, Action, CancellationToken, DayTimeTimerOptions?)

Registers a time-of-day timer that fires at the given local time each day (sync callback).

public static IClockDayTimeTimer RegisterTimeOfDay(this IPrimeClock clock, LocalTimeOfDay timeOfDay, Action callback, CancellationToken cancellationToken, DayTimeTimerOptions? timerOptions = null)

Parameters

clock IPrimeClock
timeOfDay LocalTimeOfDay

The local time of day at which to fire.

callback Action

The callback to run when the timer fires.

cancellationToken CancellationToken

Token that participates in cancelling the timer registration; pass 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.

RegisterTimeOfDay(IPrimeClock, UtcTimeOfDay, Action<ClockTimerCallbackContext, CancellationToken>, CancellationToken, object?, DayTimeTimerOptions?)

Registers a UTC time-of-day timer with a callback that receives context and cancellation token.

public static IClockDayTimeTimer RegisterTimeOfDay(this IPrimeClock clock, UtcTimeOfDay timeOfDay, Action<ClockTimerCallbackContext, CancellationToken> callback, CancellationToken cancellationToken, object? state = null, DayTimeTimerOptions? timerOptions = null)

Parameters

clock IPrimeClock
timeOfDay UtcTimeOfDay

The UTC time of day at which to fire.

callback Action<ClockTimerCallbackContext, CancellationToken>

The callback invoked when the timer fires; receives timer context and a cancellation token.

cancellationToken CancellationToken

Token that participates in cancelling the timer registration; pass 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.

RegisterTimeOfDay(IPrimeClock, UtcTimeOfDay, Action, CancellationToken, DayTimeTimerOptions?)

Registers a time-of-day timer that fires at the given UTC time each day (sync callback).

public static IClockDayTimeTimer RegisterTimeOfDay(this IPrimeClock clock, UtcTimeOfDay timeOfDay, Action callback, CancellationToken cancellationToken, DayTimeTimerOptions? timerOptions = null)

Parameters

clock IPrimeClock
timeOfDay UtcTimeOfDay

The UTC time of day at which to fire.

callback Action

The callback to run when the timer fires.

cancellationToken CancellationToken

Token that participates in cancelling the timer registration; pass 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.