Interface QueueOptions

Represents the queue options

interface QueueOptions {
    bucketSize?: number;
    highWater?: number;
    interval?: number;
    penalty?: number;
    strategy?: Strategy;
    tokensPerInterval?: number;
}

Hierarchy (View Summary)

Properties

bucketSize?: number

Set the bucket size for the rate limiter

0 If the bucket size is 0, only concurrency and delay will be used to limit the rate of the jobs. If the bucket size is greater than 0, the consumption of the tokens will be used to limit the rate of the jobs. The bucket size is the maximum number of tokens that can be consumed in the interval. The interval is defined by the tokensPerInterval and interval properties.

highWater?: number

The maximum number of jobs in the queue

Infinity
interval?: number

Define the interval in milliseconds

1000
penalty?: number

The penalty for the BLOCK strategy in milliseconds

0
strategy?: Strategy

The strategy to use when the queue length reaches highWater

'leak'
tokensPerInterval?: number

Define the number of tokens that will be added to the bucket at the beginning of the interval

1