Skip to main content
Table of Contents

Interface ITimerHandler

Namespace
Stratara.Abstractions.Timers
Assembly
Stratara.Abstractions.dll

Receives timers that are due and whose owner exists. Implemented by the host. Resolved from a fresh scope per firing, so it may take scoped dependencies.

public interface ITimerHandler
Extension Methods

Methods

OnDueAsync(TimerDue, CancellationToken)

Handles a due timer. Throwing keeps the timer registered for a retry.

Task OnDueAsync(TimerDue due, CancellationToken cancellationToken)

Parameters

due TimerDue

The timer that fired.

cancellationToken CancellationToken

Requested when the process running the handler stops and the handler has not completed within the time the host gives a stop. A handler that observes it stops; the timer stays registered and fires again elsewhere, as after a failure. A handler that ignores it runs to its end.

Returns

Task