Miss any of our Open RFC calls?Watch the recordings here! »

@seedalpha/queue

2.1.11 • Public • Published

queue

wercker status

FIFO queue for node and browser

Example

Queue()
  .add(function(next){ console.log(1); next(); })
  .add(function(next){ console.log(2); next(); })
  .add(function(next){ console.log(3); next(); })
  .end(function(error){ console.log(error, 'finish'); }); // -> 1 ; 2 ; 3 ; undefined, 'finish'


var q = new Queue();
q.add(function(next){ setInterval(function(){ next(); }, 1000); });
q.end(function(error){}); // -> will throw an error, after 2000ms (on second tick)

var q = new Queue(4, 2);
q.add(function(n, m, next) { console.log(n,m); });
q.end(function(){}); // -> 4, 2

Author

Vladimir Popov rusintez@gmail.com

License

MIT

Keywords

Install

npm i @seedalpha/queue

DownloadsWeekly Downloads

2

Version

2.1.11

License

MIT

Unpacked Size

6.72 kB

Total Files

6

Last publish

Collaborators

  • avatar
  • avatar