Queue Manager for Bull
npm install bull-qm 
If you use Bull, you've probably run into a situation in which the number of connections to your redis server
skyrocketed. Why? Because each instance of your queues created 3 connections and each instance of your application
created each queue. Easily racking up thousands of connections.
Enter the Queue Manager. At least now you can limit the number of connections a single instance makes!
EventEmitterKind: global class
Extends: EventEmitter
* QueueManager ⇐ EventEmitter
* new QueueManager(bullOpts)
* .NUM_CLIENTS ⇒ number
* .client ⇒ IORedis
* .subscriber ⇒ IORedis
* .enqueue(name, data, opts) ⇒ Promise.<Job>
* .hasQueue(name) ⇒ Boolean
* .getQueue(name, options) ⇒ BullQueue
* .getAllQueues() ⇒ Array.<BullQueue>
* .shutdown() ⇒ Promise
* .createClient(type, redisOpts, extraOpts) ⇒ IORedis
* .createQueue(name, options) ⇒ BullQueue
* .createQueue(name, options) ⇒ BullQueue
| Param | Type | Description |
| --- | --- | --- |
| bullOpts | BullOpts | The options you would normally pass to the bull queue by default |
Kind: instance property of QueueManager
Returns: number - number of clients
Kind: instance property of QueueManager
Returns: IORedis - Client (used for redis cmds)
Kind: instance property of QueueManager
Returns: IORedis - Subscriber client
Kind: instance method of QueueManager
Returns: Promise.<Job> - The Job created by Bull
| Param | Type | Description |
| --- | --- | --- |
| name | string | The name of the queue |
| data | Object | The data property for the new job |
| opts | JobOpts | Bull job options. |
Kind: instance method of QueueManager
Returns: Boolean - True if the queue has been created, false otherwise
| Param | Type | Description |
| --- | --- | --- |
| name | string | The name of the queue |
Kind: instance method of QueueManager
Returns: BullQueue - The created bull queue
| Param | Type | Description |
| --- | --- | --- |
| name | string | The name of the queue to create |
| options | BullOpts | Options to pass to bull. Options here will override any options provided by default. |
Kind: instance method of QueueManager
Returns: Array.<BullQueue> - array of bull queues
Kind: instance method of QueueManager
Returns: Promise - Resolves when all queues have been closed
Kind: instance method of QueueManager
Returns: IORedis - An instance of IORedis
See: https://github.com/OptimalBits/bull/blob/develop/PATTERNS.md#reusing-redis-connections
| Param | Type | Description |
| --- | --- | --- |
| type | string | Type of redis client |
| redisOpts | IORedisOpts | The options to pass to redis. |
| extraOpts | Object | Additional options, e.g. maxListeners (defaults to 0). |
Kind: instance method of QueueManager
Returns: BullQueue - The created bull queue
| Param | Type | Description |
| --- | --- | --- |
| name | string | The name of the queue to create |
| options | BullOpts | Options to pass to bull. Options here will override any options provided by default. |
Kind: instance method of QueueManager
Returns: BullQueue - The created bull queue
| Param | Type | Description |
| --- | --- | --- |
| name | string | The name of the queue to create |
| options | BullOpts | Options to pass to bull. Options here will override any options provided by default. |
© 2020 Mudrekh Goderya MIT