Skip to content

AsyncQueue module used for running asynchronous tasks in series

License

Notifications You must be signed in to change notification settings

LiorRabin/async-queue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

AsyncQueue module used for running asynchronous tasks in series

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published