Skip to main content

Queue

Queue can send message queues, allowing tasks to run sequentially in the background.

Usage

import { Queue } from '@giteeteam/apps-api';

// global indicates whether the key is globally unique, used for cross-application access
const queue = new Queue({ key: 'queue-name', global: false });

// define your data
const payloadData = {};
await queue.push(payloadData);

// Can be executed with a delay of 5 seconds
await queue.push(payloadData, { delayInSeconds: 5 })

Consuming Events

You can useConsumerto receive events.