Global

Members

QueueStates

# constant QueueState

Enumerates the possible states that the queue can be in.

Enumerates the possible states that the queue can be in. This object is frozen to prevent modifications to the state values.

View Source ConcurrentCallbackQueue.js, line 105

Example
const QueueState = {
  IDLE: "IDLE",
  BUSY: "BUSY",
  STOPPED: "STOPPED",
};
QueueOptions

# constant defaultQueueOptions

The default options that are used when creating a new queue.

The default options that are used when creating a new queue. This object is frozen to prevent modifications to the default values. For hooks, a do-nothing (noop) function is used.

View Source ConcurrentCallbackQueue.js, line 83

Example
const defaultQueueOptions = {
  autoStart: true,
  maxConcurrent: 10,
  onCallbackError: noop,
  onCallbackSuccess: noop,
  onQueueIdle: noop,
  onQueueBusy: noop,
  onQueueStop: noop,
};

Type Definitions

Object

# CallbackTuple

Defines the structure of a callback tuple.

Defines the structure of a callback tuple.

Properties:
Name Type Description
callback function

The callback function to execute.

retries number

Number of retry attempts in case of an error.

View Source ConcurrentCallbackQueue.js, line 49

Object

# QueueOptions

Defines all the possible options that can be set when creating a new queue.

Defines all the possible options that can be set when creating a new queue.

Properties:
Name Type Description
autoStart boolean

Indicates if the queue should start execution automatically when a callback is added.

maxConcurrent number

Maximum number of callbacks that can be executed in parallel.

onCallbackError function

Callback that is executed when an error occurs while executing a callback, receives the error as a parameter.

onCallbackSuccess function

Callback that is executed after a callback successfully executes.

onQueueIdle function

Callback that is executed when the queue goes to IDLE state.

onQueueBusy function

Callback that is executed when the queue goes to BUSY state.

onQueueStop function

Callback that is executed when the queue stops.

View Source ConcurrentCallbackQueue.js, line 27

Object

# QueueStates

Defines all the possible states the queue can be in.

Defines all the possible states the queue can be in.

Properties:
Name Type Description
IDLE string

There are no pending callbacks and the queue will start processing as soon as a callback is added.

BUSY string

Currently processing callbacks up to the maximum concurrent limit.

STOPPED string

Processing has been stopped and no further callbacks will be executed unless the queue is started again.

View Source ConcurrentCallbackQueue.js, line 40