retry

Retry a function until it succeeds or the maximum number of retries is reached.

Default maxRetries: 5.
Default backoff: 2^retries * 100ms (100, 200, 400, 800, 1600, 3200, ...)

Example