summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Yeates <yeatesgraeme@gmail.com>2016-06-19 13:56:02 -0400
committerHubert Argasinski <argasinski.hubert@gmail.com>2016-06-29 01:55:17 -0400
commitc0b433b4e165fab24b7b95b90d5536c520b7bd87 (patch)
treee60795af1a6e03e25049fae0e67f549a99e1f0da
parent15f8262818ab3d2e743b817395ea7a0ac29cab09 (diff)
downloadasync-c0b433b4e165fab24b7b95b90d5536c520b7bd87.tar.gz
Update typedef invoke docs
-rw-r--r--lib/cargo.js14
-rw-r--r--lib/queue.js20
-rw-r--r--package.json1
3 files changed, 17 insertions, 18 deletions
diff --git a/lib/cargo.js b/lib/cargo.js
index 23b6fd8..4bc5279 100644
--- a/lib/cargo.js
+++ b/lib/cargo.js
@@ -5,14 +5,14 @@ import queue from './internal/queue';
* the same methods and event callbacks as {@link async.queue}.
* @typedef {Object} CargoObject
* @property {Function} length - A function returning the number of items
- * waiting to be processed. Invoke with ().
+ * waiting to be processed. Invoke like `cargo.length()`.
* @property {number} payload - An `integer` for determining how many tasks
* should be process per round. This property can be changed after a `cargo` is
* created to alter the payload on-the-fly.
* @property {Function} push - Adds `task` to the `queue`. The callback is
* called once the `worker` has finished processing the task. Instead of a
* single task, an array of `tasks` can be submitted. The respective callback is
- * used for every task in the list. Invoke with (task, [callback]).
+ * used for every task in the list. Invoke like `cargo.push(task, [callback])`.
* @property {Function} saturated - A callback that is called when the
* `queue.length()` hits the concurrency and further tasks will be queued.
* @property {Function} empty - A callback that is called when the last item
@@ -20,13 +20,13 @@ import queue from './internal/queue';
* @property {Function} drain - A callback that is called when the last item
* from the `queue` has returned from the `worker`.
* @property {Function} idle - a function returning false if there are items
- * waiting or being processed, or true if not. Invoke with ().
+ * waiting or being processed, or true if not. Invoke like `cargo.idle()`.
* @property {Function} pause - a function that pauses the processing of tasks
- * until `resume()` is called. Invoke with ().
+ * until `resume()` is called. Invoke like `cargo.pause()`.
* @property {Function} resume - a function that resumes the processing of
- * queued tasks when the queue is paused. Invoke with ().
+ * queued tasks when the queue is paused. Invoke like `cargo.resume()`.
* @property {Function} kill - a function that removes the `drain` callback and
- * empties remaining tasks from the queue forcing it to go idle. Invoke with ().
+ * empties remaining tasks from the queue forcing it to go idle. Invoke like `cargo.kill()`.
*/
/**
@@ -48,7 +48,7 @@ import queue from './internal/queue';
* @category Control Flow
* @param {Function} worker - An asynchronous function for processing an array
* of queued tasks, which must call its `callback(err)` argument when finished,
- * with an optional `err` argument. Invoked with (tasks, callback).
+ * with an optional `err` argument. Invoked with `(tasks, callback)`.
* @param {number} [payload=Infinity] - An optional `integer` for determining
* how many tasks should be processed per round; if omitted, the default is
* unlimited.
diff --git a/lib/queue.js b/lib/queue.js
index 912b05f..db1c239 100644
--- a/lib/queue.js
+++ b/lib/queue.js
@@ -4,24 +4,24 @@ import queue from './internal/queue';
* A queue of tasks for the worker function to complete.
* @typedef {Object} QueueObject
* @property {Function} length - a function returning the number of items
- * waiting to be processed. Invoke with ().
+ * waiting to be processed. Invoke with `queue.length()`.
* @property {Function} started - a function returning whether or not any
- * items have been pushed and processed by the queue. Invoke with ().
+ * items have been pushed and processed by the queue. Invoke with `queue.started()`.
* @property {Function} running - a function returning the number of items
- * currently being processed. Invoke with ().
+ * currently being processed. Invoke with `queue.running()`.
* @property {Function} workersList - a function returning the array of items
- * currently being processed. Invoke with ().
+ * currently being processed. Invoke with `queue.workersList()`.
* @property {Function} idle - a function returning false if there are items
- * waiting or being processed, or true if not. Invoke with ().
+ * waiting or being processed, or true if not. Invoke with `queue.idle()`.
* @property {number} 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 alter the concurrency on-the-fly.
* @property {Function} push - add a new task to the `queue`. Calls `callback`
* once the `worker` has finished processing the task. Instead of a single task,
* a `tasks` array can be submitted. The respective callback is used for every
- * task in the list. Invoke with (task, [callback]),
+ * task in the list. Invoke with `queue.push(task, [callback])`,
* @property {Function} unshift - add a new task to the front of the `queue`.
- * Invoke with (task, [callback]).
+ * Invoke with `queue.unshift(task, [callback])`.
* @property {Function} saturated - a callback that is called when the number of
* running workers hits the `concurrency` limit, and further tasks will be
* queued.
@@ -39,11 +39,11 @@ import queue from './internal/queue';
* @property {boolean} paused - a boolean for determining whether the queue is
* in a paused state.
* @property {Function} pause - a function that pauses the processing of tasks
- * until `resume()` is called. Invoke with ().
+ * until `resume()` is called. Invoke with `queue.pause()`.
* @property {Function} resume - a function that resumes the processing of
- * queued tasks when the queue is paused. Invoke with ().
+ * queued tasks when the queue is paused. Invoke with `queue.length()`.
* @property {Function} kill - a function that removes the `drain` callback and
- * empties remaining tasks from the queue forcing it to go idle. Invoke with ().
+ * empties remaining tasks from the queue forcing it to go idle. Invoke with `queue.kill()`.
*/
/**
diff --git a/package.json b/package.json
index 1e14cfe..3972813 100644
--- a/package.json
+++ b/package.json
@@ -41,7 +41,6 @@
"karma-firefox-launcher": "^0.1.6",
"karma-mocha": "^0.2.0",
"karma-mocha-reporter": "^1.0.2",
- "minami": "^1.1.1",
"mocha": "^2.2.5",
"native-promise-only": "^0.8.0-a",
"nyc": "^2.1.0",