Enumeration EVENTS

Events emitted on the Queue instance.

Example

import { Queue, EVENTS } from "queue-system";
const q = new Queue();
q.on(EVENTS.TASK_ADD, () => sendNotification("New task just got added"));

Enumeration Members

QUEUE_ORDER: "queue-order"

Emitted when the queue size is changed (task is added or removed from the queue), with a tasks list as a parameter

QUEUE_SIZE: "queue-size"

Emitted when the queue size is changed (task is added or removed from the queue), with a number of tasks in it as a parameter

TASK_ADD: "task-add"

Emitted when a task is added to the queue (no matter of position)

TASK_END: "task-end"

Emitted when a task finishes its run

TASK_ERROR: "task-error"

Emitted when an async task finishes its run with an error (Promise rejects)

TASK_REMOVE: "task-remove"

Emitted when a task is removed from the queue

TASK_START: "task-start"

Emitted when a task is run

TASK_SUCCESS: "task-success"

Emitted when a task finishes its run with a success (Promise resolves or simply no reject for synchronous task)

TASK_THROWN: "task-thrown"

Emitted when an sync task throws an error

Generated using TypeDoc