Node.js - queue()

Creates a new Queue to send and receive asynchronous tasks.

import { queue } from '@nitric/sdk';

const batchQueue = queue('batch').for('sending');


name required string

The unique name of this Queue within the app. Subsequent calls to queue with the same name will return the same object.


All Nitric resources provide access permissions you can use to specify the level of access your code needs to the resource. See here for details Access Control documentation.

Available permissions:


This permission allows your code to send new tasks to the queue.


This permission allows your code to receive tasks from the queue.


In most instances, code should either send to or receive from a queue, usually not both.


Create a Queue

import { queue } from '@nitric/sdk';

const batchQueue = queue('batch');

Receive tasks from a queue

import { queue } from '@nitric/sdk';

const payload = {};
const batchQueue = queue('batch').for('receiving');

await batchQueue.send([{ payload }]);