Table of Contents

Method FindStateAsync

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

FindStateAsync(JobId, CancellationToken)

Reads where one job stands, which is what a caller holding an identifier asks before acting on it.

Task<JobState?> FindStateAsync(JobId jobId, CancellationToken cancellationToken)

Parameters

jobId JobId

The job to read.

cancellationToken CancellationToken

Cancels the read.

Returns

Task<JobState?>

The job's state, or null when no job carries that identifier.

Remarks

A reading rather than a guarantee. The state can move the instant after it is read, so what it supports is a decision that is safe to get wrong occasionally — a recurring dispatch standing down while the previous one is still going, where an unlucky read costs one occasion — and never an exclusion, which is what the lease is for.