Class JobQueueOptions
options for job queues
Inherited Members
Namespace: FastEndpoints
Assembly: FastEndpoints.dll
Syntax
public class JobQueueOptions
Properties
ExecutionTimeLimit
the per job type max execution time limit for handler executions unless otherwise overridden using LimitsFor<TCommand>(int, TimeSpan) defaults to Infinite.
Declaration
public TimeSpan ExecutionTimeLimit { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan |
MaxConcurrency
the default max concurrency per job type. default value is the number of logical processors of the computer. you can specify per queue type overrides using LimitsFor<TCommand>(int, TimeSpan)
Declaration
public int MaxConcurrency { get; set; }
Property Value
Type | Description |
---|---|
int |
Methods
LimitsFor<TCommand>(int, TimeSpan)
specify execution limits such a max concurrency and execution time limit for a given command type.
Declaration
public void LimitsFor<TCommand>(int maxConcurrency, TimeSpan timeLimit) where TCommand : ICommand
Parameters
Type | Name | Description |
---|---|---|
int | maxConcurrency | the maximum number of command executions of the same command type that's allowed to execute at the same time |
TimeSpan | timeLimit | the maximum amount of time each command is allowed to execute for. when execution time exceeds this value, a OperationCanceledException will be thrown. when that happens you can handle it in the OnHandlerExecutionFailureAsync(TStorageRecord, Exception, CancellationToken) method. |
Type Parameters
Name | Description |
---|---|
TCommand | the type of the command the limits apply to |