[Pkg-javascript-commits] [node-async] 310/480: clarified cargo documentation
Jonas Smedegaard
js at moszumanska.debian.org
Fri May 2 08:58:37 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 4af8215b32a903b2ac2d0c60d08c9b511c4ad480
Author: Brian Maissy <brian.maissy at gmail.com>
Date: Mon Mar 11 11:47:40 2013 +0200
clarified cargo documentation
---
README.md | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index 09ea6df..75b2a12 100644
--- a/README.md
+++ b/README.md
@@ -979,9 +979,9 @@ the worker has completed some tasks, each callback of those tasks is called.
__Arguments__
-* worker(tasks, callback) - An asynchronous function for processing queued
- tasks, which must call its callback(err) argument when finished, with an
- optional error as an argument.
+* worker(tasks, callback) - An asynchronous function for processing an array of
+ queued tasks, which must call its callback(err) argument when finished, with
+ an optional error as an argument.
* payload - An optional integer for determining how many tasks should be
processed per round; if omitted, the default is unlimited.
@@ -1006,8 +1006,10 @@ __Example__
```js
// create a cargo object with payload 2
-var cargo = async.cargo(function (task, callback) {
- console.log('hello ' + task.name);
+var cargo = async.cargo(function (tasks, callback) {
+ for(var i=0; i<tasks.length; i++){
+ console.log('hello ' + task[i].name);
+ }
callback();
}, 2);
--
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