From 4ebb214974bb7242b3deb3067e84f1141d2c726d Mon Sep 17 00:00:00 2001 From: Andrii Kolomiichenko Date: Mon, 24 Aug 2015 01:52:39 +0700 Subject: [PATCH] Added workersList() method into queue --- README.md | 1 + dist/async.js | 14 ++++++++++++++ dist/async.min.js | 2 +- dist/async.min.map | 2 +- lib/async.js | 14 ++++++++++++++ 5 files changed, 31 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c0a93c1b1..340329998 100644 --- a/README.md +++ b/README.md @@ -1120,6 +1120,7 @@ methods: * `length()` - a function returning the number of items waiting to be processed. * `started` - a function returning whether or not any items have been pushed and processed by the queue * `running()` - a function returning the number of items currently being processed. +* `workersList()` - a function returning the array of items currently being processed. * `idle()` - a function returning false if there are items waiting or being processed, or true if not. * `concurrency` - an integer for determining how many `worker` functions should be run in parallel. This property can be changed after a `queue` is created to diff --git a/dist/async.js b/dist/async.js index 1f1e0effa..309771fee 100644 --- a/dist/async.js +++ b/dist/async.js @@ -863,8 +863,17 @@ function _next(q, tasks) { return function(){ workers -= 1; + + var removed = false; var args = arguments; _arrayEach(tasks, function (task) { + _arrayEach(workersList, function (worker, index) { + if (worker === task && !removed) { + workersList.splice(index, 1); + removed = true; + } + }); + task.callback.apply(task, args); }); if (q.tasks.length + workers === 0) { @@ -875,6 +884,7 @@ } var workers = 0; + var workersList = []; var q = { tasks: [], concurrency: concurrency, @@ -909,6 +919,7 @@ q.empty(); } workers += 1; + workersList.push(tasks[0]); var cb = only_once(_next(q, tasks)); worker(data, cb); } @@ -920,6 +931,9 @@ running: function () { return workers; }, + workersList: function () { + return workersList; + }, idle: function() { return q.tasks.length + workers === 0; }, diff --git a/dist/async.min.js b/dist/async.min.js index 01b394f6d..038046499 100644 --- a/dist/async.min.js +++ b/dist/async.min.js @@ -1,2 +1,2 @@ -!function(){function n(){}function t(n){return n}function e(n){return!!n}function r(n){return!n}function u(n){return function(){if(null===n)throw new Error("Callback was already called.");n.apply(this,arguments),n=null}}function i(n){return function(){null!==n&&(n.apply(this,arguments),n=null)}}function o(n){return U(n)||"number"==typeof n.length&&n.length>=0&&n.length%1===0}function c(n,t){return o(n)?a(n,t):p(n,t)}function a(n,t){for(var e=-1,r=n.length;++er?r:null}):(e=B(n),t=e.length,function(){return r++,t>r?e[r]:null})}function y(n,t){return t=null==t?n.length-1:+t,function(){for(var e=Math.max(arguments.length-t,0),r=Array(e),u=0;e>u;u++)r[u]=arguments[u+t];switch(t){case 0:return n.call(this,r);case 1:return n.call(this,arguments[0],r)}}}function v(n){return function(t,e,r){return n(t,r)}}function d(t){return function(e,r,o){o=i(o||n),e=e||[];var c=m(e);if(0>=t)return o(null);var a=!1,f=0,l=!1;!function s(){if(a&&0>=f)return o(null);for(;t>f&&!l;){var n=c();if(null===n)return a=!0,void(0>=f&&o(null));f+=1,r(e[n],n,u(function(n){f-=1,n?(o(n),l=!0):s()}))}}()}}function g(n){return function(t,e,r){return n(P.eachOf,t,e,r)}}function k(n){return function(t,e,r,u){return n(d(e),t,r,u)}}function b(n){return function(t,e,r){return n(P.eachOfSeries,t,e,r)}}function w(t,e,r,u){u=i(u||n);var o=[];t(e,function(n,t,e){r(n,function(n,r){o[t]=r,e(n)})},function(n){u(n,o)})}function O(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(e){e&&u.push({index:t,value:n}),r()})},function(){r(f(u.sort(function(n,t){return n.index-t.index}),function(n){return n.value}))})}function S(n,t,e,r){O(n,t,function(n,t){e(n,function(n){t(!n)})},r)}function E(n,t,e){return function(r,u,i,o){function c(){o&&o(e(!1,void 0))}function a(n,r,u){return o?void i(n,function(r){o&&t(r)&&(o(e(!0,n)),o=i=!1),u()}):u()}arguments.length>3?n(r,u,a,c):(o=i,i=u,n(r,a,c))}}function x(n,t){return t}function L(t,e,r){r=r||n;var u=o(e)?[]:{};t(e,function(n,t,e){n(y(function(n,r){r.length<=1&&(r=r[0]),u[t]=r,e(n)}))},function(n){r(n,u)})}function j(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(n,t){u=u.concat(t||[]),r(n)})},function(n){r(n,u)})}function I(t,e,r){function i(t,e,r,u){if(null!=u&&"function"!=typeof u)throw new Error("task callback must be a function");return t.started=!0,U(e)||(e=[e]),0===e.length&&t.idle()?P.setImmediate(function(){t.drain()}):(a(e,function(e){var i={data:e,callback:u||n};r?t.tasks.unshift(i):t.tasks.push(i),t.tasks.length===t.concurrency&&t.saturated()}),void P.setImmediate(t.process))}function o(n,t){return function(){c-=1;var e=arguments;a(t,function(n){n.callback.apply(n,e)}),n.tasks.length+c===0&&n.drain(),n.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var c=0,l={tasks:[],concurrency:e,payload:r,saturated:n,empty:n,drain:n,started:!1,paused:!1,push:function(n,t){i(l,n,!1,t)},kill:function(){l.drain=n,l.tasks=[]},unshift:function(n,t){i(l,n,!0,t)},process:function(){if(!l.paused&&c=t;t++)P.setImmediate(l.process)}}};return l}function T(n){return y(function(t,e){t.apply(null,e.concat([y(function(t,e){"object"==typeof console&&(t?console.error&&console.error(t):console[n]&&a(e,function(t){console[n](t)}))})]))})}function A(n){return function(t,e,r){n(l(t),e,r)}}function z(n){return y(function(t,e){var r=y(function(e){var r=this,u=e.pop();return n(t,function(n,t,u){n.apply(r,e.concat([u]))},u)});return e.length?r.apply(this,e):r})}function q(n){return y(function(t){var e=t.pop();t.push(function(){var n=arguments;r?P.setImmediate(function(){e.apply(null,n)}):e.apply(null,n)});var r=!0;n.apply(this,t),r=!1})}var C,P={},H="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this;null!=H&&(C=H.async),P.noConflict=function(){return H.async=C,P};var M=Object.prototype.toString,U=Array.isArray||function(n){return"[object Array]"===M.call(n)},W=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},B=Object.keys||function(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(e);return t},D="function"==typeof setImmediate&&setImmediate,F=D?function(n){D(n)}:function(n){setTimeout(n,0)};"object"==typeof process&&"function"==typeof process.nextTick?P.nextTick=process.nextTick:P.nextTick=F,P.setImmediate=D?F:P.nextTick,P.forEach=P.each=function(n,t,e){return P.eachOf(n,v(t),e)},P.forEachSeries=P.eachSeries=function(n,t,e){return P.eachOfSeries(n,v(t),e)},P.forEachLimit=P.eachLimit=function(n,t,e,r){return d(t)(n,v(e),r)},P.forEachOf=P.eachOf=function(t,e,r){function a(n){n?r(n):(l+=1,l>=f&&r(null))}r=i(r||n),t=t||[];var f=o(t)?t.length:B(t).length,l=0;return f?void c(t,function(n,r){e(t[r],r,u(a))}):r(null)},P.forEachOfSeries=P.eachOfSeries=function(t,e,r){function o(){var n=!0;return null===a?r(null):(e(t[a],a,u(function(t){if(t)r(t);else{if(a=c(),null===a)return r(null);n?P.nextTick(o):o()}})),void(n=!1))}r=i(r||n),t=t||[];var c=m(t),a=c();o()},P.forEachOfLimit=P.eachOfLimit=function(n,t,e,r){d(t)(n,e,r)},P.map=g(w),P.mapSeries=b(w),P.mapLimit=k(w),P.inject=P.foldl=P.reduce=function(n,t,e,r){P.eachOfSeries(n,function(n,r,u){e(t,n,function(n,e){t=e,u(n)})},function(n){r(n||null,t)})},P.foldr=P.reduceRight=function(n,e,r,u){var i=f(n,t).reverse();P.reduce(i,e,r,u)},P.select=P.filter=g(O),P.selectLimit=P.filterLimit=k(O),P.selectSeries=P.filterSeries=b(O),P.reject=g(S),P.rejectLimit=k(S),P.rejectSeries=b(S),P.any=P.some=E(P.eachOf,e,t),P.someLimit=E(P.eachOfLimit,e,t),P.all=P.every=E(P.eachOf,r,r),P.everyLimit=E(P.eachOfLimit,r,r),P.detect=E(P.eachOf,t,x),P.detectSeries=E(P.eachOfSeries,t,x),P.detectLimit=E(P.eachOfLimit,t,x),P.sortBy=function(n,t,e){function r(n,t){var e=n.criteria,r=t.criteria;return r>e?-1:e>r?1:0}P.map(n,function(n,e){t(n,function(t,r){t?e(t):e(null,{value:n,criteria:r})})},function(n,t){return n?e(n):void e(null,f(t.sort(r),function(n){return n.value}))})},P.auto=function(t,e){function r(n){m.unshift(n)}function u(n){var t=h(m,n);t>=0&&m.splice(t,1)}function o(){f--,a(m.slice(0),function(n){n()})}e=i(e||n);var c=B(t),f=c.length;if(!f)return e(null);var l={},m=[];r(function(){f||e(null,l)}),a(c,function(n){function i(){return s(v,function(n,t){return n&&l.hasOwnProperty(t)},!0)&&!l.hasOwnProperty(n)}function c(){i()&&(u(c),f[f.length-1](m,l))}for(var a,f=U(t[n])?t[n]:[t[n]],m=y(function(t,r){if(r.length<=1&&(r=r[0]),t){var u={};p(l,function(n,t){u[t]=n}),u[n]=r,e(t,u)}else l[n]=r,P.setImmediate(o)}),v=f.slice(0,f.length-1),d=v.length;d--;){if(!(a=t[v[d]]))throw new Error("Has inexistant dependency");if(U(a)&&h(a,n)>=0)throw new Error("Has cyclic dependencies")}i()?f[f.length-1](m,l):r(c)})},P.retry=function(n,t,e){function r(n,t){if("number"==typeof t)n.times=parseInt(t,10)||i;else{if("object"!=typeof t)throw new Error("Unsupported argument type for 'times': "+typeof t);n.times=parseInt(t.times,10)||i,n.interval=parseInt(t.interval,10)||o}}function u(n,t){function e(n,e){return function(r){n(function(n,t){r(!n||e,{err:n,result:t})},t)}}function r(n){return function(t){setTimeout(function(){t(null)},n)}}for(;a.times;){var u=!(a.times-=1);c.push(e(a.task,u)),!u&&a.interval>0&&c.push(r(a.interval))}P.series(c,function(t,e){e=e[e.length-1],(n||a.callback)(e.err,e.result)})}var i=5,o=0,c=[],a={times:i,interval:o},f=arguments.length;if(1>f||f>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=f&&"function"==typeof n&&(e=t,t=n),"function"!=typeof n&&r(a,n),a.callback=e,a.task=t,a.callback?u():u},P.waterfall=function(t,e){function r(n){return y(function(t,u){if(t)e.apply(null,[t].concat(u));else{var i=n.next();i?u.push(r(i)):u.push(e),q(n).apply(null,u)}})}if(e=i(e||n),!U(t)){var u=new Error("First argument to waterfall must be an array of functions");return e(u)}return t.length?void r(P.iterator(t))():e()},P.parallel=function(n,t){L(P.eachOf,n,t)},P.parallelLimit=function(n,t,e){L(d(t),n,e)},P.series=function(n,t){L(P.eachOfSeries,n,t)},P.iterator=function(n){function t(e){function r(){return n.length&&n[e].apply(null,arguments),r.next()}return r.next=function(){return er;){var i=r+(u-r+1>>>1);e(t,n[i])>=0?r=i:u=i-1}return r}function i(t,e,i,o){if(null!=o&&"function"!=typeof o)throw new Error("task callback must be a function");return t.started=!0,U(e)||(e=[e]),0===e.length?P.setImmediate(function(){t.drain()}):void a(e,function(e){var c={data:e,priority:i,callback:"function"==typeof o?o:n};t.tasks.splice(u(t.tasks,c,r)+1,0,c),t.tasks.length===t.concurrency&&t.saturated(),P.setImmediate(t.process)})}var o=P.queue(t,e);return o.push=function(n,t,e){i(o,n,t,e)},delete o.unshift,o},P.cargo=function(n,t){return I(n,1,t)},P.log=T("log"),P.dir=T("dir"),P.memoize=function(n,e){var r={},u={};e=e||t;var i=y(function(t){var i=t.pop(),o=e.apply(null,t);o in r?P.nextTick(function(){i.apply(null,r[o])}):o in u?u[o].push(i):(u[o]=[i],n.apply(null,t.concat([y(function(n){r[o]=n;var t=u[o];delete u[o];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,n)})])))});return i.memo=r,i.unmemoized=n,i},P.unmemoize=function(n){return function(){return(n.unmemoized||n).apply(null,arguments)}},P.times=A(P.map),P.timesSeries=A(P.mapSeries),P.timesLimit=function(n,t,e,r){return P.mapLimit(l(n),t,e,r)},P.seq=function(){var t=arguments;return y(function(e){var r=this,u=e[e.length-1];"function"==typeof u?e.pop():u=n,P.reduce(t,e,function(n,t,e){t.apply(r,n.concat([y(function(n,t){e(n,t)})]))},function(n,t){u.apply(r,[n].concat(t))})})},P.compose=function(){return P.seq.apply(null,Array.prototype.reverse.call(arguments))},P.applyEach=z(P.eachOf),P.applyEachSeries=z(P.eachOfSeries),P.forever=function(t,e){function r(n){return n?i(n):void o(r)}var i=u(e||n),o=q(t);r()},P.ensureAsync=q,P.constant=y(function(n){var t=[null].concat(n);return function(n){return n.apply(this,t)}}),P.wrapSync=P.asyncify=function(n){return y(function(t){var e,r=t.pop();try{e=n.apply(this,t)}catch(u){return r(u)}W(e)&&"function"==typeof e.then?e.then(function(n){r(null,n)})["catch"](function(n){r(n.message?n:new Error(n))}):r(null,e)})},"object"==typeof module&&module.exports?module.exports=P:"function"==typeof define&&define.amd?define([],function(){return P}):H.async=P}(); +!function(){function n(){}function t(n){return n}function e(n){return!!n}function r(n){return!n}function u(n){return function(){if(null===n)throw new Error("Callback was already called.");n.apply(this,arguments),n=null}}function i(n){return function(){null!==n&&(n.apply(this,arguments),n=null)}}function o(n){return U(n)||"number"==typeof n.length&&n.length>=0&&n.length%1===0}function c(n,t){return o(n)?a(n,t):p(n,t)}function a(n,t){for(var e=-1,r=n.length;++er?r:null}):(e=B(n),t=e.length,function(){return r++,t>r?e[r]:null})}function y(n,t){return t=null==t?n.length-1:+t,function(){for(var e=Math.max(arguments.length-t,0),r=Array(e),u=0;e>u;u++)r[u]=arguments[u+t];switch(t){case 0:return n.call(this,r);case 1:return n.call(this,arguments[0],r)}}}function v(n){return function(t,e,r){return n(t,r)}}function d(t){return function(e,r,o){o=i(o||n),e=e||[];var c=m(e);if(0>=t)return o(null);var a=!1,f=0,l=!1;!function s(){if(a&&0>=f)return o(null);for(;t>f&&!l;){var n=c();if(null===n)return a=!0,void(0>=f&&o(null));f+=1,r(e[n],n,u(function(n){f-=1,n?(o(n),l=!0):s()}))}}()}}function g(n){return function(t,e,r){return n(P.eachOf,t,e,r)}}function k(n){return function(t,e,r,u){return n(d(e),t,r,u)}}function b(n){return function(t,e,r){return n(P.eachOfSeries,t,e,r)}}function w(t,e,r,u){u=i(u||n);var o=[];t(e,function(n,t,e){r(n,function(n,r){o[t]=r,e(n)})},function(n){u(n,o)})}function O(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(e){e&&u.push({index:t,value:n}),r()})},function(){r(f(u.sort(function(n,t){return n.index-t.index}),function(n){return n.value}))})}function S(n,t,e,r){O(n,t,function(n,t){e(n,function(n){t(!n)})},r)}function E(n,t,e){return function(r,u,i,o){function c(){o&&o(e(!1,void 0))}function a(n,r,u){return o?void i(n,function(r){o&&t(r)&&(o(e(!0,n)),o=i=!1),u()}):u()}arguments.length>3?n(r,u,a,c):(o=i,i=u,n(r,a,c))}}function L(n,t){return t}function x(t,e,r){r=r||n;var u=o(e)?[]:{};t(e,function(n,t,e){n(y(function(n,r){r.length<=1&&(r=r[0]),u[t]=r,e(n)}))},function(n){r(n,u)})}function j(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(n,t){u=u.concat(t||[]),r(n)})},function(n){r(n,u)})}function I(t,e,r){function i(t,e,r,u){if(null!=u&&"function"!=typeof u)throw new Error("task callback must be a function");return t.started=!0,U(e)||(e=[e]),0===e.length&&t.idle()?P.setImmediate(function(){t.drain()}):(a(e,function(e){var i={data:e,callback:u||n};r?t.tasks.unshift(i):t.tasks.push(i),t.tasks.length===t.concurrency&&t.saturated()}),void P.setImmediate(t.process))}function o(n,t){return function(){c-=1;var e=!1,r=arguments;a(t,function(n){a(l,function(t,r){t!==n||e||(l.splice(r,1),e=!0)}),n.callback.apply(n,r)}),n.tasks.length+c===0&&n.drain(),n.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var c=0,l=[],s={tasks:[],concurrency:e,payload:r,saturated:n,empty:n,drain:n,started:!1,paused:!1,push:function(n,t){i(s,n,!1,t)},kill:function(){s.drain=n,s.tasks=[]},unshift:function(n,t){i(s,n,!0,t)},process:function(){if(!s.paused&&c=t;t++)P.setImmediate(s.process)}}};return s}function T(n){return y(function(t,e){t.apply(null,e.concat([y(function(t,e){"object"==typeof console&&(t?console.error&&console.error(t):console[n]&&a(e,function(t){console[n](t)}))})]))})}function A(n){return function(t,e,r){n(l(t),e,r)}}function z(n){return y(function(t,e){var r=y(function(e){var r=this,u=e.pop();return n(t,function(n,t,u){n.apply(r,e.concat([u]))},u)});return e.length?r.apply(this,e):r})}function q(n){return y(function(t){var e=t.pop();t.push(function(){var n=arguments;r?P.setImmediate(function(){e.apply(null,n)}):e.apply(null,n)});var r=!0;n.apply(this,t),r=!1})}var C,P={},H="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this;null!=H&&(C=H.async),P.noConflict=function(){return H.async=C,P};var M=Object.prototype.toString,U=Array.isArray||function(n){return"[object Array]"===M.call(n)},W=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},B=Object.keys||function(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(e);return t},D="function"==typeof setImmediate&&setImmediate,F=D?function(n){D(n)}:function(n){setTimeout(n,0)};"object"==typeof process&&"function"==typeof process.nextTick?P.nextTick=process.nextTick:P.nextTick=F,P.setImmediate=D?F:P.nextTick,P.forEach=P.each=function(n,t,e){return P.eachOf(n,v(t),e)},P.forEachSeries=P.eachSeries=function(n,t,e){return P.eachOfSeries(n,v(t),e)},P.forEachLimit=P.eachLimit=function(n,t,e,r){return d(t)(n,v(e),r)},P.forEachOf=P.eachOf=function(t,e,r){function a(n){n?r(n):(l+=1,l>=f&&r(null))}r=i(r||n),t=t||[];var f=o(t)?t.length:B(t).length,l=0;return f?void c(t,function(n,r){e(t[r],r,u(a))}):r(null)},P.forEachOfSeries=P.eachOfSeries=function(t,e,r){function o(){var n=!0;return null===a?r(null):(e(t[a],a,u(function(t){if(t)r(t);else{if(a=c(),null===a)return r(null);n?P.nextTick(o):o()}})),void(n=!1))}r=i(r||n),t=t||[];var c=m(t),a=c();o()},P.forEachOfLimit=P.eachOfLimit=function(n,t,e,r){d(t)(n,e,r)},P.map=g(w),P.mapSeries=b(w),P.mapLimit=k(w),P.inject=P.foldl=P.reduce=function(n,t,e,r){P.eachOfSeries(n,function(n,r,u){e(t,n,function(n,e){t=e,u(n)})},function(n){r(n||null,t)})},P.foldr=P.reduceRight=function(n,e,r,u){var i=f(n,t).reverse();P.reduce(i,e,r,u)},P.select=P.filter=g(O),P.selectLimit=P.filterLimit=k(O),P.selectSeries=P.filterSeries=b(O),P.reject=g(S),P.rejectLimit=k(S),P.rejectSeries=b(S),P.any=P.some=E(P.eachOf,e,t),P.someLimit=E(P.eachOfLimit,e,t),P.all=P.every=E(P.eachOf,r,r),P.everyLimit=E(P.eachOfLimit,r,r),P.detect=E(P.eachOf,t,L),P.detectSeries=E(P.eachOfSeries,t,L),P.detectLimit=E(P.eachOfLimit,t,L),P.sortBy=function(n,t,e){function r(n,t){var e=n.criteria,r=t.criteria;return r>e?-1:e>r?1:0}P.map(n,function(n,e){t(n,function(t,r){t?e(t):e(null,{value:n,criteria:r})})},function(n,t){return n?e(n):void e(null,f(t.sort(r),function(n){return n.value}))})},P.auto=function(t,e){function r(n){m.unshift(n)}function u(n){var t=h(m,n);t>=0&&m.splice(t,1)}function o(){f--,a(m.slice(0),function(n){n()})}e=i(e||n);var c=B(t),f=c.length;if(!f)return e(null);var l={},m=[];r(function(){f||e(null,l)}),a(c,function(n){function i(){return s(v,function(n,t){return n&&l.hasOwnProperty(t)},!0)&&!l.hasOwnProperty(n)}function c(){i()&&(u(c),f[f.length-1](m,l))}for(var a,f=U(t[n])?t[n]:[t[n]],m=y(function(t,r){if(r.length<=1&&(r=r[0]),t){var u={};p(l,function(n,t){u[t]=n}),u[n]=r,e(t,u)}else l[n]=r,P.setImmediate(o)}),v=f.slice(0,f.length-1),d=v.length;d--;){if(!(a=t[v[d]]))throw new Error("Has inexistant dependency");if(U(a)&&h(a,n)>=0)throw new Error("Has cyclic dependencies")}i()?f[f.length-1](m,l):r(c)})},P.retry=function(n,t,e){function r(n,t){if("number"==typeof t)n.times=parseInt(t,10)||i;else{if("object"!=typeof t)throw new Error("Unsupported argument type for 'times': "+typeof t);n.times=parseInt(t.times,10)||i,n.interval=parseInt(t.interval,10)||o}}function u(n,t){function e(n,e){return function(r){n(function(n,t){r(!n||e,{err:n,result:t})},t)}}function r(n){return function(t){setTimeout(function(){t(null)},n)}}for(;a.times;){var u=!(a.times-=1);c.push(e(a.task,u)),!u&&a.interval>0&&c.push(r(a.interval))}P.series(c,function(t,e){e=e[e.length-1],(n||a.callback)(e.err,e.result)})}var i=5,o=0,c=[],a={times:i,interval:o},f=arguments.length;if(1>f||f>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=f&&"function"==typeof n&&(e=t,t=n),"function"!=typeof n&&r(a,n),a.callback=e,a.task=t,a.callback?u():u},P.waterfall=function(t,e){function r(n){return y(function(t,u){if(t)e.apply(null,[t].concat(u));else{var i=n.next();i?u.push(r(i)):u.push(e),q(n).apply(null,u)}})}if(e=i(e||n),!U(t)){var u=new Error("First argument to waterfall must be an array of functions");return e(u)}return t.length?void r(P.iterator(t))():e()},P.parallel=function(n,t){x(P.eachOf,n,t)},P.parallelLimit=function(n,t,e){x(d(t),n,e)},P.series=function(n,t){x(P.eachOfSeries,n,t)},P.iterator=function(n){function t(e){function r(){return n.length&&n[e].apply(null,arguments),r.next()}return r.next=function(){return er;){var i=r+(u-r+1>>>1);e(t,n[i])>=0?r=i:u=i-1}return r}function i(t,e,i,o){if(null!=o&&"function"!=typeof o)throw new Error("task callback must be a function");return t.started=!0,U(e)||(e=[e]),0===e.length?P.setImmediate(function(){t.drain()}):void a(e,function(e){var c={data:e,priority:i,callback:"function"==typeof o?o:n};t.tasks.splice(u(t.tasks,c,r)+1,0,c),t.tasks.length===t.concurrency&&t.saturated(),P.setImmediate(t.process)})}var o=P.queue(t,e);return o.push=function(n,t,e){i(o,n,t,e)},delete o.unshift,o},P.cargo=function(n,t){return I(n,1,t)},P.log=T("log"),P.dir=T("dir"),P.memoize=function(n,e){var r={},u={};e=e||t;var i=y(function(t){var i=t.pop(),o=e.apply(null,t);o in r?P.nextTick(function(){i.apply(null,r[o])}):o in u?u[o].push(i):(u[o]=[i],n.apply(null,t.concat([y(function(n){r[o]=n;var t=u[o];delete u[o];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,n)})])))});return i.memo=r,i.unmemoized=n,i},P.unmemoize=function(n){return function(){return(n.unmemoized||n).apply(null,arguments)}},P.times=A(P.map),P.timesSeries=A(P.mapSeries),P.timesLimit=function(n,t,e,r){return P.mapLimit(l(n),t,e,r)},P.seq=function(){var t=arguments;return y(function(e){var r=this,u=e[e.length-1];"function"==typeof u?e.pop():u=n,P.reduce(t,e,function(n,t,e){t.apply(r,n.concat([y(function(n,t){e(n,t)})]))},function(n,t){u.apply(r,[n].concat(t))})})},P.compose=function(){return P.seq.apply(null,Array.prototype.reverse.call(arguments))},P.applyEach=z(P.eachOf),P.applyEachSeries=z(P.eachOfSeries),P.forever=function(t,e){function r(n){return n?i(n):void o(r)}var i=u(e||n),o=q(t);r()},P.ensureAsync=q,P.constant=y(function(n){var t=[null].concat(n);return function(n){return n.apply(this,t)}}),P.wrapSync=P.asyncify=function(n){return y(function(t){var e,r=t.pop();try{e=n.apply(this,t)}catch(u){return r(u)}W(e)&&"function"==typeof e.then?e.then(function(n){r(null,n)})["catch"](function(n){r(n.message?n:new Error(n))}):r(null,e)})},"object"==typeof module&&module.exports?module.exports=P:"function"==typeof define&&define.amd?define([],function(){return P}):H.async=P}(); //# sourceMappingURL=async.min.map \ No newline at end of file diff --git a/dist/async.min.map b/dist/async.min.map index 339898f2d..3e16da97f 100644 --- a/dist/async.min.map +++ b/dist/async.min.map @@ -1 +1 @@ -{"version":3,"file":"async.min.js","sources":["async.js"],"names":["noop","identity","v","toBool","notId","only_once","fn","Error","apply","this","arguments","_once","_isArrayLike","arr","_isArray","length","_each","coll","iterator","_arrayEach","_forEachOf","index","_map","result","Array","_range","count","i","_reduce","memo","x","a","object","_keys","key","_indexOf","item","_keyIterator","len","keys","_restParam","func","startIndex","Math","max","rest","call","_withoutIndex","value","callback","_eachOfLimit","limit","obj","nextKey","done","running","errored","replenish","err","doParallel","async","eachOf","doParallelLimit","doSeries","eachOfSeries","_asyncMap","eachfn","results","_filter","push","sort","b","_reject","cb","_createTester","check","getResult","iteratee","_","_findGetResult","_parallel","tasks","task","args","_concat","y","concat","_queue","worker","concurrency","payload","_insert","q","data","pos","started","idle","setImmediate","drain","unshift","saturated","process","_next","workers","empty","paused","kill","splice","pause","resume","resumeCount","min","w","_console_fn","name","console","error","_times","mapper","_applyEach","fns","go","that","pop","ensureAsync","innerArgs","sync","previous_async","root","self","global","noConflict","_toString","Object","prototype","toString","isArray","_isObject","type","k","hasOwnProperty","_setImmediate","_delay","setTimeout","nextTick","forEach","each","forEachSeries","eachSeries","forEachLimit","eachLimit","forEachOf","completed","size","forEachOfSeries","iterate","forEachOfLimit","eachOfLimit","map","mapSeries","mapLimit","inject","foldl","reduce","foldr","reduceRight","reversed","reverse","select","filter","selectLimit","filterLimit","selectSeries","filterSeries","reject","rejectLimit","rejectSeries","any","some","someLimit","all","every","everyLimit","detect","detectSeries","detectLimit","sortBy","comparator","left","right","criteria","auto","addListener","listeners","removeListener","idx","taskComplete","remainingTasks","slice","ready","requires","listener","taskCallback","dep","safeResults","val","rkey","retry","times","parseTimes","acc","t","parseInt","DEFAULT_TIMES","interval","DEFAULT_INTERVAL","wrappedTask","wrappedCallback","wrappedResults","retryAttempt","finalAttempt","seriesCallback","retryInterval","opts","attempts","series","waterfall","wrapIterator","next","parallel","parallelLimit","makeCallback","callArgs","concatSeries","whilst","test","doWhilst","calls","until","doUntil","during","truth","doDuring","queue","items","priorityQueue","_compareTasks","priority","_binarySearch","sequence","compare","beg","end","mid","cargo","log","dir","memoize","hasher","queues","memoized","l","unmemoized","unmemoize","timesSeries","timesLimit","seq","newargs","nextargs","compose","applyEach","applyEachSeries","forever","constant","values","wrapSync","asyncify","e","then","message","module","exports","define","amd"],"mappings":"CAOC,WAGG,QAASA,MACT,QAASC,GAASC,GACd,MAAOA,GAEX,QAASC,GAAOD,GACZ,QAASA,EAEb,QAASE,GAAMF,GACX,OAAQA,EAsBZ,QAASG,GAAUC,GACf,MAAO,YACH,GAAW,OAAPA,EAAa,KAAM,IAAIC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,IAC5CD,UAAW,WACP,MAAO9N,KAKXoE,EAAKpE,MAAQA"} \ No newline at end of file +{"version":3,"file":"async.min.js","sources":["async.js"],"names":["noop","identity","v","toBool","notId","only_once","fn","Error","apply","this","arguments","_once","_isArrayLike","arr","_isArray","length","_each","coll","iterator","_arrayEach","_forEachOf","index","_map","result","Array","_range","count","i","_reduce","memo","x","a","object","_keys","key","_indexOf","item","_keyIterator","len","keys","_restParam","func","startIndex","Math","max","rest","call","_withoutIndex","value","callback","_eachOfLimit","limit","obj","nextKey","done","running","errored","replenish","err","doParallel","async","eachOf","doParallelLimit","doSeries","eachOfSeries","_asyncMap","eachfn","results","_filter","push","sort","b","_reject","cb","_createTester","check","getResult","iteratee","_","_findGetResult","_parallel","tasks","task","args","_concat","y","concat","_queue","worker","concurrency","payload","_insert","q","data","pos","started","idle","setImmediate","drain","unshift","saturated","process","_next","workers","removed","workersList","splice","empty","paused","kill","pause","resume","resumeCount","min","w","_console_fn","name","console","error","_times","mapper","_applyEach","fns","go","that","pop","ensureAsync","innerArgs","sync","previous_async","root","self","global","noConflict","_toString","Object","prototype","toString","isArray","_isObject","type","k","hasOwnProperty","_setImmediate","_delay","setTimeout","nextTick","forEach","each","forEachSeries","eachSeries","forEachLimit","eachLimit","forEachOf","completed","size","forEachOfSeries","iterate","forEachOfLimit","eachOfLimit","map","mapSeries","mapLimit","inject","foldl","reduce","foldr","reduceRight","reversed","reverse","select","filter","selectLimit","filterLimit","selectSeries","filterSeries","reject","rejectLimit","rejectSeries","any","some","someLimit","all","every","everyLimit","detect","detectSeries","detectLimit","sortBy","comparator","left","right","criteria","auto","addListener","listeners","removeListener","idx","taskComplete","remainingTasks","slice","ready","requires","listener","taskCallback","dep","safeResults","val","rkey","retry","times","parseTimes","acc","t","parseInt","DEFAULT_TIMES","interval","DEFAULT_INTERVAL","wrappedTask","wrappedCallback","wrappedResults","retryAttempt","finalAttempt","seriesCallback","retryInterval","opts","attempts","series","waterfall","wrapIterator","next","parallel","parallelLimit","makeCallback","callArgs","concatSeries","whilst","test","doWhilst","calls","until","doUntil","during","truth","doDuring","queue","items","priorityQueue","_compareTasks","priority","_binarySearch","sequence","compare","beg","end","mid","cargo","log","dir","memoize","hasher","queues","memoized","l","unmemoized","unmemoize","timesSeries","timesLimit","seq","newargs","nextargs","compose","applyEach","applyEachSeries","forever","constant","values","wrapSync","asyncify","e","then","message","module","exports","define","amd"],"mappings":"CAOC,WAGG,QAASA,MACT,QAASC,GAASC,GACd,MAAOA,GAEX,QAASC,GAAOD,GACZ,QAASA,EAEb,QAASE,GAAMF,GACX,OAAQA,EAsBZ,QAASG,GAAUC,GACf,MAAO,YACH,GAAW,OAAPA,EAAa,KAAM,IAAIC,OAAM,+BACjCD,GAAGE,MAAMC,KAAMC,WACfJ,EAAK,MAIb,QAASK,GAAML,GACX,MAAO,YACQ,OAAPA,IACJA,EAAGE,MAAMC,KAAMC,WACfJ,EAAK,OAkBb,QAASM,GAAaC,GAClB,MAAOC,GAASD,IAEU,gBAAfA,GAAIE,QACXF,EAAIE,QAAU,GACdF,EAAIE,OAAS,IAAM,EAI3B,QAASC,GAAMC,EAAMC,GACjB,MAAON,GAAaK,GAChBE,EAAWF,EAAMC,GACjBE,EAAWH,EAAMC,GAGzB,QAASC,GAAWN,EAAKK,GAIrB,IAHA,GAAIG,GAAQ,GACRN,EAASF,EAAIE,SAERM,EAAQN,GACbG,EAASL,EAAIQ,GAAQA,EAAOR,GAIpC,QAASS,GAAKT,EAAKK,GAKf,IAJA,GAAIG,GAAQ,GACRN,EAASF,EAAIE,OACbQ,EAASC,MAAMT,KAEVM,EAAQN,GACbQ,EAAOF,GAASH,EAASL,EAAIQ,GAAQA,EAAOR,EAEhD,OAAOU,GAGX,QAASE,GAAOC,GACZ,MAAOJ,GAAKE,MAAME,GAAQ,SAAUxB,EAAGyB,GAAK,MAAOA,KAGvD,QAASC,GAAQf,EAAKK,EAAUW,GAI5B,MAHAV,GAAWN,EAAK,SAAUiB,EAAGH,EAAGI,G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sBJ1K,EAAMkE,YAAcA,EAEpBlE,EAAMuN,SAAW3O,EAAW,SAAS4O,GACjC,GAAIjM,IAAQ,MAAMG,OAAO8L,EACzB,OAAO,UAAUnO,GACb,MAAOA,GAASzC,MAAMC,KAAM0E,MAIpCvB,EAAMyN,SACNzN,EAAM0N,SAAW,SAAkB7O,GAC/B,MAAOD,GAAW,SAAU2C,GACxB,GACI5D,GADA0B,EAAWkC,EAAK0C,KAEpB,KACItG,EAASkB,EAAKjC,MAAMC,KAAM0E,GAC5B,MAAOoM,GACL,MAAOtO,GAASsO,GAGhB5I,EAAUpH,IAAkC,kBAAhBA,GAAOiQ,KACnCjQ,EAAOiQ,KAAK,SAASxO,GACjBC,EAAS,KAAMD,KAChB,SAAS,SAASU,GACjBT,EAASS,EAAI+N,QAAU/N,EAAM,GAAInD,OAAMmD,MAG3CT,EAAS,KAAM1B,MAML,gBAAXmQ,SAAuBA,OAAOC,QACrCD,OAAOC,QAAU/N,EAGM,kBAAXgO,SAAyBA,OAAOC,IAC5CD,UAAW,WACP,MAAOhO,KAKXsE,EAAKtE,MAAQA"} \ No newline at end of file diff --git a/lib/async.js b/lib/async.js index 1f1e0effa..309771fee 100644 --- a/lib/async.js +++ b/lib/async.js @@ -863,8 +863,17 @@ function _next(q, tasks) { return function(){ workers -= 1; + + var removed = false; var args = arguments; _arrayEach(tasks, function (task) { + _arrayEach(workersList, function (worker, index) { + if (worker === task && !removed) { + workersList.splice(index, 1); + removed = true; + } + }); + task.callback.apply(task, args); }); if (q.tasks.length + workers === 0) { @@ -875,6 +884,7 @@ } var workers = 0; + var workersList = []; var q = { tasks: [], concurrency: concurrency, @@ -909,6 +919,7 @@ q.empty(); } workers += 1; + workersList.push(tasks[0]); var cb = only_once(_next(q, tasks)); worker(data, cb); } @@ -920,6 +931,9 @@ running: function () { return workers; }, + workersList: function () { + return workersList; + }, idle: function() { return q.tasks.length + workers === 0; },