Executes an async function with backoff retry logic. If the function fails, it will be retried with increasing delays between attempts.
The last error encountered if all attempts fail
// With default parameters (3 attempts, 150ms base):// 1st try: immediate// 1st retry: 300ms delay (2^1 * 150)// 2nd retry: 600ms delay (2^2 * 150)// 3rd retry: 1200ms delay (2^3 * 150) Copy
// With default parameters (3 attempts, 150ms base):// 1st try: immediate// 1st retry: 300ms delay (2^1 * 150)// 2nd retry: 600ms delay (2^2 * 150)// 3rd retry: 1200ms delay (2^3 * 150)
The async function to execute
Maximum number of retry attempts (default: 3)
Base delay in milliseconds for exponential backoff (default: 150)
The type of backoff to use (default: 'exponential')
Promise resolving to the function's result
Executes an async function with backoff retry logic. If the function fails, it will be retried with increasing delays between attempts.
Throws
The last error encountered if all attempts fail
Example