Interface QueueInit<JobReturnType, JobOptions>

interface QueueInit<JobReturnType, JobOptions> {
    concurrency?: number;
    maxSize?: number;
    metricName?: string;
    metrics?: Metrics;
    sort?: Comparator<Job<JobOptions, JobReturnType>>;
}

Type Parameters

Properties

concurrency?: number

Concurrency limit.

Minimum: 1.

Default

Infinity
maxSize?: number

If the queue size grows to larger than this number the promise returned from the add function will reject

Default

Infinity
metricName?: string

The name of the metric for the queue length

metrics?: Metrics

An implementation of the libp2p Metrics interface

An optional function that will sort the queue after a job has been added