-
Notifications
You must be signed in to change notification settings - Fork 16
/
deno_retry.deno.txt
18 lines (13 loc) · 1.67 KB
/
deno_retry.deno.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
DENO_RETRY
VERSION ==> #Part of Deno
#Browser compatible
@std/async/retry.ts #
retry(FUNC()->[>]VAL)->>VAL #Return FUNC(), but retry on failure
#When reaching maxAttempts, throw RetryError
OPTS.maxAttempts #NUM (def: 5)
OPTS.minTimeout #NUM (in ms, def: 1s)
OPTS.maxTimeout #NUM (in ms, def: 1 min). Does not stop retry, just max timeout between retries
OPTS.multiplier #NUM (def: 2) multiplying backoff factor
OPTS.jitter #NUM (def: 1) multiplying backoff factor with randomness