Table of Contents

Method AcquireAsync

Namespace
MailFathom.Application.Jobs.Execution
Assembly
MailFathom.Application.dll

AcquireAsync(JobType, CancellationToken)

Waits until this process may run one more job of the given type.

public Task<IDisposable> AcquireAsync(JobType jobType, CancellationToken cancellationToken)

Parameters

jobType JobType

The type the job about to run belongs to.

cancellationToken CancellationToken

Abandons the wait.

Returns

Task<IDisposable>

The held capacity, which is given back when it is disposed.

Remarks

A cancelled wait gives back whatever it had already taken, so an abandoned acquisition leaves the ceilings exactly where it found them.

Exceptions

ArgumentException

Thrown when jobType names no declared job type.

OperationCanceledException

Thrown when cancellationToken is cancelled while waiting.