special sponsors

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

Adds a retry method to all Promise instances.

Kind: global function
Returns: Promise - A Promise
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.


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


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

Kind: global function

  • http://bluebirdjs.com/docs/api-reference.html
  • https://github.com/petkaantonov/bluebird/issues/1397