Asynchronous-Semaphore is a project mainly written in JavaScript, it's free.
Asynchronous Semaphore
ASemaphore is a structure that let you fire a method only after N async functions have been executed.
(The name has been extracted out of Semaphore
Latest Version 0.1
ASemaphore is a module:
1) Require it: var ASemaphore = require("./ASemaphore"), 2) Construct it: var sem = ASemaphore.ctor(0,function(args..) { //some code to fire }); 3) Before any Async call: sem.v(); 4) Nested to the callback function call: sem.p(args..);
Requires Node.JS v0.1.99 or greater.
test.js
thanks to http://gist.github.com/540427 (ryedin)
Please let us know if you find any bug or if you would like to contribute code: mrohad.jsf at gmail