[Pkg-javascript-commits] [node-async] 273/480: corrected the documentation of forEachLimit and mapLimit: the items are not processed in batches. Addresses issue #203

Jonas Smedegaard js at moszumanska.debian.org
Fri May 2 08:58:33 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository node-async.

commit b62eff026b94b35ad20bf9144ddf1d6bec7b7fb5
Author: Brian Maissy <brian.maissy at gmail.com>
Date:   Wed Feb 6 01:01:13 2013 +0200

    corrected the documentation of forEachLimit and mapLimit: the items are not processed in batches. Addresses issue #203
---
 README.md | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/README.md b/README.md
index 041aef6..5f343ef 100644
--- a/README.md
+++ b/README.md
@@ -159,14 +159,17 @@ processing. This means the iterator functions will complete in order.
 <a name="forEachLimit" />
 ### forEachLimit(arr, limit, iterator, callback)
 
-The same as forEach only the iterator is applied to batches of items in the
-array, in series. The next batch of iterators is only called once the current
-one has completed processing.
+The same as forEach only no more than "limit" iterators will be simultaneously 
+running at any time.
+
+Note that the items are not processed in batches, so there is no guarantee that
+ the first "limit" iterator functions will complete before any others are 
+started.
 
 __Arguments__
 
 * arr - An array to iterate over.
-* limit - How many items should be in each batch.
+* limit - The maximum number of iterators to run at any time.
 * iterator(item, callback) - A function to apply to each item in the array.
   The iterator is passed a callback which must be called once it has completed.
   If no error has occured, the callback should be run without arguments or 
@@ -234,14 +237,17 @@ processing. The results array will be in the same order as the original.
 <a name="mapLimit" />
 ### mapLimit(arr, limit, iterator, callback)
 
-The same as map only the iterator is applied to batches of items in the
-array, in series. The next batch of iterators is only called once the current
-one has completed processing.
+The same as map only no more than "limit" iterators will be simultaneously 
+running at any time.
+
+Note that the items are not processed in batches, so there is no guarantee that
+ the first "limit" iterator functions will complete before any others are 
+started.
 
 __Arguments__
 
 * arr - An array to iterate over.
-* limit - How many items should be in each batch.
+* limit - The maximum number of iterators to run at any time.
 * iterator(item, callback) - A function to apply to each item in the array.
   The iterator is passed a callback which must be called once it has completed.
   If no error has occured, the callback should be run without arguments or 
@@ -670,6 +676,9 @@ function(err, results) {
 The same as parallel only the tasks are executed in parallel with a maximum of "limit" 
 tasks executing at any time.
 
+Note that the tasks are not executed in batches, so there is no guarantee that 
+the first "limit" tasks will complete before any others are started.
+
 __Arguments__
 
 * tasks - An array or object containing functions to run, each function is passed a

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-async.git



More information about the Pkg-javascript-commits mailing list