Method Create
- Namespace
- MailFathom.Application.Jobs
- Assembly
- MailFathom.Application.dll
Create(IReadOnlyList<JobType>, int, TimeSpan, JobLeaseOwner)
States what this process can run and how long it would hold it for.
public static JobClaimRequest Create(IReadOnlyList<JobType> handledTypes, int batchSize, TimeSpan leaseDuration, JobLeaseOwner owner)
Parameters
handledTypesIReadOnlyList<JobType>The job types this process has a handler for.
batchSizeintThe greatest number of jobs to take.
leaseDurationTimeSpanHow long each claimed job is held.
ownerJobLeaseOwnerThe attempt the claimed jobs are stamped with.
Returns
- JobClaimRequest
The validated claim.
Exceptions
- ArgumentNullException
Thrown when
handledTypesorowneris null.- ArgumentException
Thrown when
handledTypesis empty, repeats a type, or holds the unspecified default.- ArgumentOutOfRangeException
Thrown when
batchSizeis not positive orleaseDurationis not positive.