Table of Contents

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

session IPersistenceSession

The session committing the vectors that call produced.

inputCharacterCount long

The characters the call sent.

cancellationToken CancellationToken

Propagates 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 session is null.

ArgumentOutOfRangeException

Thrown when the count is negative.