Table of Contents

Method RunAsync

Namespace
MailFathom.Application.Spam
Assembly
MailFathom.Application.dll

RunAsync(IJobPayload, CancellationToken)

Runs the work the payload describes.

public Task RunAsync(IJobPayload payload, CancellationToken cancellationToken)

Parameters

payload IJobPayload

The references the work is described by, of the contract JobType names.

cancellationToken CancellationToken

Cancels the work at the execution timeout, at host shutdown, and when the lease is lost.

Returns

Task

A task that completes when the work is done.

Remarks

An email nothing is stored under for the payload's account ends the job as done rather than as a failure. Mail can be erased between the moment a classification was asked for and the moment it runs, and that is the message leaving rather than work to attempt again; an account that does not hold the email is answered the same way, so no job can classify one person's mail under another's settings.

Exceptions

OperationCanceledException

Thrown when the work observes cancellation and stops.

ArgumentException

Thrown when the payload is not the contract this job type names.