Table of Contents

Constructor LeasedJob

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

LeasedJob(JobId, JobType, JobIdempotencyKey, IJobPayload, MailAccountId?, int, JobLease)

One job a claim handed to one attempt, with the lease that attempt holds it under.

public LeasedJob(JobId JobId, JobType JobType, JobIdempotencyKey Key, IJobPayload Payload, MailAccountId? AccountId, int AttemptCount, JobLease Lease)

Parameters

JobId JobId

The job this attempt holds.

JobType JobType

The kind of work, which is also the contract its payload was read back as.

Key JobIdempotencyKey

The identity the execution was enqueued under.

Payload IJobPayload

The references the work is described by.

AccountId MailAccountId?

The account the work belongs to, or null when it belongs to none.

AttemptCount int

Which attempt this is, counting from one.

Lease JobLease

The lease this attempt holds the job under.

Remarks

The attempt number counts from one and includes this attempt, so a job being run for the first time reports one. It is counted by the claim rather than by whatever runs the work, because a process that dies mid-execution never reaches a line that would have counted it and its attempt would otherwise be invisible.