This releases introduces a ton of changes to the internal workings of the system, allowing much better control over things. The changes include the introduction of ticket based work and work completion (instead of type based completion).
Now, when you run something, you get a work ticket returned:
var ticket = limiter.run("some-type", function(done){
// do stuff
});and when you want to complete that work, you have to complete the ticket:
limiter.complete(ticket)This allows you to also "complete" work that has been queued but not yet run. When you complete a ticket, the work for that ticket will be removed from the queue.