Table of Contents

Method ReserveAsync

Namespace
MailFathom.Application.EmailContent.Storage
Assembly
MailFathom.Application.dll

ReserveAsync(long, CancellationToken)

Reserves room for one payload, waiting until the budget has it.

public Task<RawMimeMemoryReservation> ReserveAsync(long bytes, CancellationToken cancellationToken)

Parameters

bytes long

How many bytes the caller is about to hold.

cancellationToken CancellationToken

Abandons the wait; a reservation already granted is unaffected.

Returns

Task<RawMimeMemoryReservation>

The reservation, which returns its bytes to the budget when it is disposed.

Exceptions

ArgumentOutOfRangeException

Thrown when bytes is not positive or exceeds CapacityBytes, which no wait could ever satisfy.

OperationCanceledException

Thrown when the caller cancelled before the budget had room.