Create a Queue
When you create a queue, you specify the maxInflight and the msgPerSecond parameters. Using those in conjunction will allow you to control the dequeue rate.
Method Signature
createQueue(queueName: string, callback: string, options: ICreateQueueOptions)
Types
CreateQueueOptions:
maxInflight: (Number) The number of tasks you can concurrently execute.msgPerSecond: (Number) The number of tasks to be send to your callback endpoint per second.active: (Boolean)truewill set the queue to begin processing jobs as soon as they are added.
Creating a Queue
await queue.createQueue('queue', 'execute', {
maxInflight: 10,
msgPerSecond: 100,
active: true
});
options = CreateQueueOptions()
options.maxInflight = 10
options.msgPerSecond = 100
options.active = true
await queue.createQueue('queue', options)