0.1.2 • Published 7 years ago
promises-extra v0.1.2
promises-extra
Adds useful promise helper functions.
Supported features
retry(computation, every = 1.5, trials = 10)
executescomputation
and if it fails, reruns itevery
second(s) untiltrials
.sequence(computations, concurrency = 1)
executes a list ofcomputations
. Also, allows specifyingconcurrency
(must be greater than or equal to 1) which runs at mostconcurrency
computations in parallel.throttle(computation, delay)
executescomputation
and makes sure that it takes at leastdelay
seconds. Ifcomputation
takes longer thandelay
, additional delay will not be applied.
Change log
- 0.0.1 -- Initial release.
- 0.1.0 -- Fix delay bug in
retry
function. Simplify signature ofsequence
function. - 0.1.1 -- Add context to
retry
to allow abort retrying early. - 0.1.2 -- Add debugging.