summaryrefslogtreecommitdiff
path: root/lib/retry.js
diff options
context:
space:
mode:
authorAlexander Early <alexander.early@gmail.com>2017-04-01 15:05:52 -0700
committerAlexander Early <alexander.early@gmail.com>2017-04-01 15:05:52 -0700
commit94a8b2d18bf10cca67cf4c308253f642bbb2b160 (patch)
tree001afe9b92618fe3ce75e7bdd0979e59ee0a8d63 /lib/retry.js
parentfaf395c546747c2066e673405e0aec94362811a0 (diff)
downloadasync-94a8b2d18bf10cca67cf4c308253f642bbb2b160.tar.gz
use the AsyncFunction type in all docs :sweat:
Diffstat (limited to 'lib/retry.js')
-rw-r--r--lib/retry.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/retry.js b/lib/retry.js
index e279016..bd60644 100644
--- a/lib/retry.js
+++ b/lib/retry.js
@@ -13,6 +13,7 @@ import wrapAsync from './internal/wrapAsync';
* @memberOf module:ControlFlow
* @method
* @category Control Flow
+ * @see [async.retryable]{@link module:ControlFlow.retryable}
* @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an
* object with `times` and `interval` or a number.
* * `times` - The number of attempts to make before giving up. The default
@@ -27,16 +28,13 @@ import wrapAsync from './internal/wrapAsync';
* Invoked with (err).
* * If `opts` is a number, the number specifies the number of times to retry,
* with the default interval of `0`.
- * @param {Function} task - A function which receives two arguments: (1) a
- * `callback(err, result)` which must be called when finished, passing `err`
- * (which can be `null`) and the `result` of the function's execution, and (2)
- * a `results` object, containing the results of the previously executed
- * functions (if nested inside another control flow). Invoked with
- * (callback, results).
+ * @param {AsyncFunction} task - An async function to retry.
+ * Invoked with (callback).
* @param {Function} [callback] - An optional callback which is called when the
* task has succeeded, or after the final failed attempt. It receives the `err`
* and `result` arguments of the last attempt at completing the `task`. Invoked
* with (err, results).
+ *
* @example
*
* // The `retry` function can be used as a stand-alone control flow by passing
@@ -82,7 +80,7 @@ import wrapAsync from './internal/wrapAsync';
* // individual methods that are not as reliable, like this:
* async.auto({
* users: api.getUsers.bind(api),
- * payments: async.retry(3, api.getPayments.bind(api))
+ * payments: async.retryable(3, api.getPayments.bind(api))
* }, function(err, results) {
* // do something with the results
* });