-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Description
Code:
var AsyncLock = require("async-lock");
var lock = new AsyncLock();
function work(cb) {
return setTimeout(cb, 1000);
}
function done(err, ret) {
console.log("done", err);
}
lock.acquire(["A", "B", "C"], work, done);
lock.acquire(["A", "B", "C"], work, done);Output:
done undefined
node_modules\async-lock\lib\index.js:86
self.queues[key].shift()();
^
TypeError: self.queues[key].shift(...) is not a function
at done (C:\Source\eXLent_master\exlent\node_modules\async-lock\lib\index.js:86:35)
at C:\Source\eXLent_master\exlent\node_modules\async-lock\lib\index.js:111:9
at done (C:\Source\eXLent_master\exlent\node_modules\async-lock\lib\index.js:68:12)
at Timeout._onTimeout (C:\Source\eXLent_master\exlent\node_modules\async-lock\lib\index.js:111:9)
at tryOnTimeout (timers.js:224:11)
at Timer.listOnTimeout (timers.js:198:5)Metadata
Metadata
Assignees
Labels
No labels