Skip to content

franela/batchq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BatchQ

Simple queue implementation which calls a callback every time the capacity is reached

Example

var BatchQueue = require('batchq');

var batchq = new BatchQueue(5, function() {
    console.log(this.splice(0,this.length)) //Will print [0,1,2,3,4]
});

batchq.push(0,1,2,3,4);
console.log(batchq.length); //Will be 1 as callback was executed
batchq.push(5);
batch.flush();  //Forces the callback to run as capacity hasn't been reached

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published