worker q
Introduction
This is a Node.js based module for queuing asynchronous work.
Disclaimer: Please don't share WorkerQ objects across threads; actions are not designed to be thread safe!
Dependencies
None (it uses setTimeout() for async)
Examples
Do an npm install worker-q.
var WorkerQ = ; var { ;}; //1 is serial execution. 2+ is parallel. Experiment with different numbersvar activeJobsLimit = 2;var myAwesomeQueue = activeJobsLimit; var myAwesomeWork = { ; } { ; } { ; } { ; }; myAwesomeQueue;myAwesomeQueue; //note that only 2 jobs are queued initially. If you increase the// activeJobsLimit from 2, then add more jobs to the queue from the startmyAwesomeQueue;myAwesomeQueue;myAwesomeQueuestart;
License
Apache 2