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
workloadstringWhich paced workload's marker to move, as it is recorded.
intervalTimeSpanHow far apart this workload's requests are spaced.
cancellationTokenCancellationTokenCancels the reservation.
Returns
Exceptions
- ArgumentException
Thrown when
workloadnames nothing.- ArgumentOutOfRangeException
Thrown when
intervalis not positive.