dumb-queue
A simple and performant queue that handles async functions in order, with a wait time between each callback. It can be used as a rate limiter or to ensure asynchroneous operations are synchroneous, and not in parallel (which can be a wide source of bugs in many systems and software architectures).
Install
npm install @pyrsmk/dumb-queue
Usage
const queue = require('dumb-queue')(1000)
queue.add(() => someAsyncSlowAction1())
queue.add(() => someAsyncSlowAction2())
queue.add(async () => someSyncSlowAction3())
await queue.wait()
Compatibility
Node 8+