Create a new instance of Queue
The queue options
Dequeues and returns the next job in the queue
The next job, or undefined if the queue is empty
Drops the oldest job in the queue with the lowest priority if not priority is provided, and drops the oldest job with a lower priority than the provided priority otherwise
Optional
priority: numberThe priority of the job to drop
The dropped job, or undefined if the queue is empty
Enqueues a job with optional priority
The job to enqueue
Peeks the next job in the queue
The next job, or undefined if the queue is empty
Emitted when a job is enqueued
Emitted when a job is dequeued
Emitted when a job is removed
Emitted when the queue is cleared
Emitted when the queue is blocked
Emitted when the queue is unblocked
Emitted when the queue is empty
Emitted when the bucket is refilled
Emitted when the queue is empty and a job is enqueued
Removes a job from the queue
The uuid of the job to remove
Represents a queue