lando.Promise.retry(fn, [opts]) ⇒ Promise

Adds a retry method to all Promise instances.

Since: 3.0.0

Param Type Default Description
fn function The function to retry.
[opts] Opts Options to specify how retry works.
[opts.max] Integer 5 The amount of times to retry.
[opts.backoff] Integer 500 The amount to wait between retries. In miliseconds and cumulative.

Returns: Promise - A Promise
Example

// And then retry 25 times until we've connected, increase delay between retries by 1 second
Promise.retry(someFunction, {max: 25, backoff: 1000});

lando.Promise()

Extends bluebird so that our promises have some retry functionality.

All functionality should be the same as bluebird except where indicated below

Note that bluebird currently wants you to use scoped prototypes to extend it rather than the normal extend syntax so that is why this is using the "old" way

See

results matching ""

    No results matching ""