Skip to content

Nodejs in-process blocking FIFO queue implementation.

Notifications You must be signed in to change notification settings

hit9/node-block-queue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nodejs Blocking Queue

Nodejs in-process blocking FIFO queue implementation.

Queue with max cocurrency.

npm install block-queue

Example

var queue = require('block-queue');

var q = queue(1, function(task, done) {
    // working on task..
    done();
});

q.push('task1');
q.push('task2');
q.push('task3');

See also: example-1.js and example-2.js.

API Ref

queue([cocurrency, ]reducer)

  • cocurrency, integer, optional, default: 1
  • reducer, function, required should be called with 2 parameters: task, done.

queue.push(task)

  • task, mixed, required.

queue.clear()

License

MIT.

About

Nodejs in-process blocking FIFO queue implementation.

Resources

Stars

Watchers

Forks

Packages

No packages published