summaryrefslogtreecommitdiff
path: root/lib/internal/queue.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/internal/queue.js')
-rw-r--r--lib/internal/queue.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/internal/queue.js b/lib/internal/queue.js
index 479eaf8..2eb523a 100644
--- a/lib/internal/queue.js
+++ b/lib/internal/queue.js
@@ -1,7 +1,6 @@
import indexOf from 'lodash/_baseIndexOf';
import isArray from 'lodash/isArray';
import noop from 'lodash/noop';
-import rest from './rest';
import onlyOnce from './onlyOnce';
import setImmediate from './setImmediate';
@@ -51,7 +50,7 @@ export default function queue(worker, concurrency, payload) {
}
function _next(tasks) {
- return rest(function(args){
+ return function(err){
numRunning -= 1;
for (var i = 0, l = tasks.length; i < l; i++) {
@@ -61,10 +60,10 @@ export default function queue(worker, concurrency, payload) {
workersList.splice(index)
}
- task.callback.apply(task, args);
+ task.callback.apply(task, arguments);
- if (args[0] != null) {
- q.error(args[0], task.data);
+ if (err != null) {
+ q.error(err, task.data);
}
}
@@ -76,7 +75,7 @@ export default function queue(worker, concurrency, payload) {
q.drain();
}
q.process();
- });
+ };
}
var isProcessing = false;