Table of Contents

Method ReserveNextSlotAsync

Namespace
MailFathom.Application.AiProviders
Assembly
MailFathom.Application.dll

ReserveNextSlotAsync(string, TimeSpan, CancellationToken)

Takes the paced workload's next slot and reports how long its caller has to wait for it.

Task<TimeSpan> ReserveNextSlotAsync(string workload, TimeSpan interval, CancellationToken cancellationToken)

Parameters

workload string

Which paced workload's marker to move, as it is recorded.

interval TimeSpan

How far apart this workload's requests are spaced.

cancellationToken CancellationToken

Cancels the reservation.

Returns

Task<TimeSpan>

How long to wait before sending, which is zero where the slot has already arrived.

Exceptions

ArgumentException

Thrown when workload names nothing.

ArgumentOutOfRangeException

Thrown when interval is not positive.