Method RecordSpendAsync
- Namespace
- MailFathom.Application.Emails.Embeddings.Limits
- Assembly
- MailFathom.Application.dll
RecordSpendAsync(IPersistenceSession, long, CancellationToken)
Charges one provider call to the period it happened in.
public Task RecordSpendAsync(IPersistenceSession session, long inputCharacterCount, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe session committing the vectors that call produced.
inputCharacterCountlongThe characters the call sent.
cancellationTokenCancellationTokenPropagates caller cancellation.
Returns
- Task
A task that completes when the charge has been issued inside the caller's transaction.
Remarks
A deployment with no ceiling is charged exactly as one with a ceiling is. The count is what an operator watches to decide whether to declare a ceiling at all, so leaving it unwritten would make the figure appear only once it was already too late to be useful.
Exceptions
- ArgumentNullException
Thrown when
sessionis null.- ArgumentOutOfRangeException
Thrown when the count is negative.