summaryrefslogtreecommitdiff
path: root/lib/queue.js
diff options
context:
space:
mode:
authorAlexander Early <alexander.early@gmail.com>2017-03-25 15:26:14 -0700
committerAlexander Early <alexander.early@gmail.com>2017-03-25 15:26:14 -0700
commitdb9face308f5d00ca98c8d3c2080949b1db50ab7 (patch)
treefa70cc16dc33fbb4921dcde8deae8b3578b5640a /lib/queue.js
parentffd66850df894a5a961c8f2d21d75d0796448ce9 (diff)
downloadasync-db9face308f5d00ca98c8d3c2080949b1db50ab7.tar.gz
handle async funcs in control flow methods
Diffstat (limited to 'lib/queue.js')
-rw-r--r--lib/queue.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/queue.js b/lib/queue.js
index 5666843..0f17cd9 100644
--- a/lib/queue.js
+++ b/lib/queue.js
@@ -1,4 +1,5 @@
import queue from './internal/queue';
+import wrapAsync from './internal/wrapAsync';
/**
* A queue of tasks for the worker function to complete.
@@ -101,7 +102,8 @@ import queue from './internal/queue';
* });
*/
export default function (worker, concurrency) {
+ var _worker = wrapAsync(worker);
return queue(function (items, cb) {
- worker(items[0], cb);
+ _worker(items[0], cb);
}, concurrency, 1);
}