RedisSMQ / Docs / API Reference / Queue
The Queue class represents an interface that interacts with Redis for storing and managing queues. It provides functionality to create, check existence, delete, retrieve properties of queues, and manage shutdown operations.
• new Queue(): Queue
▸ delete(queue
, cb
): void
Delete a specific queue.
Name | Type | Description |
---|---|---|
queue |
string | IQueueParams |
The name or parameters for the queue to be deleted. |
cb |
ICallback <void > |
Callback function to handle success or error. |
void
▸ exists(queue
, cb
): void
Checks if a specified queue exists.
Name | Type | Description |
---|---|---|
queue |
string | IQueueParams |
The name or parameters for the queue. |
cb |
ICallback <boolean > |
Callback function to return a boolean indicating the existence of the queue. |
void
▸ getProperties(queue
, cb
): void
Retrieves the properties of a specified queue.
Name | Type | Description |
---|---|---|
queue |
string | IQueueParams |
The name or parameters for the queue. |
cb |
ICallback <IQueueProperties > |
Callback function to return the queue properties or an error. |
void
▸ getQueues(cb
): void
Fetches all existing queues.
Name | Type | Description |
---|---|---|
cb |
ICallback <IQueueParams []> |
Callback function to return with a list of queues or an error. |
void
▸ save(queue
, queueType
, deliveryModel
, cb
): void
Save a new queue with specified parameters. Upon success the callback function is invoked with the created queue details.
Name | Type | Description |
---|---|---|
queue |
string | IQueueParams |
The name or parameters for the queue. |
queueType |
EQueueType |
The type of the queue, defined by EQueueType. |
deliveryModel |
EQueueDeliveryModel |
The model for message delivery, defined by EQueueDeliveryModel. |
cb |
ICallback <{ properties : IQueueProperties ; queue : IQueueParams }> |
Callback function to handle success or error. |
void
See
- https://github.com/weyoss/redis-smq/blob/master/docs/api/enums/EQueueType.md
- https://github.com/weyoss/redis-smq/blob/master/docs/api/enums/EQueueDeliveryModel.md
▸ shutdown(cb
): void
Cleans up resources by shutting down the Redis client and event bus.
Name | Type | Description |
---|---|---|
cb |
ICallback <void > |
Callback function to handle completion of the shutdown process. |
void