summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolan McMahon <caolan@caolanmcmahon.com>2013-02-06 04:54:48 -0800
committerCaolan McMahon <caolan@caolanmcmahon.com>2013-02-06 04:54:48 -0800
commit914fa108489c03acf63447d4e7bab7573080af4a (patch)
tree394dc1dc15eb77c03714c626d01f255d406e5bbe
parent9ad8dba9b780b7294e27e11d8bd0a6b6bbf6681f (diff)
parentb62eff026b94b35ad20bf9144ddf1d6bec7b7fb5 (diff)
downloadasync-914fa108489c03acf63447d4e7bab7573080af4a.tar.gz
Merge pull request #227 from brianmaissy/master
Documentation correction, addressing issue #203
-rw-r--r--README.md25
1 files 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