@liorrabin/async-queue

1.0.3 • Public • Published

AsyncQueue

AsyncQueue module used for running asynchronous tasks in series

Install

npm i @liorrabin/async-queue

Test

npm test

Usage

const AsyncQueue = require('@liorrabin/async-queue')

const queue = new AsyncQueue(fn) // create new queue with `fn` as the function to run on each task
queue.add('param1', 'param2')    // add fn('param1', 'param2') to queue and start running immediately
queue.isRunning()                // check if queue is currently running
queue.next()                     // get next task to run
queue.all()                      // get all tasks in the queue

License

MIT

Package Sidebar

Install

npm i @liorrabin/async-queue

Weekly Downloads

4

Version

1.0.3

License

MIT

Unpacked Size

4.45 kB

Total Files

6

Last publish

Collaborators

  • liorrabin