Protected ReadonlybackProtected ReadonlyloggerProtected ReadonlyretryExecute the callback function with the given options.
The type of the return value of the callback function.
The callback function to execute.
The options for retrying the task.
const result = await retryOperations.execute(async () => {
// do something
}, { maxAttempts: 3, timeout: 1000 });
console.log(result);
const result = await retryOperations.execute(async () => {
// do something
}, { maxAttempts: 3, timeout: 1000, backOffOptions: { delay: 1000 } });
console.log(result);
const result = await retryOperations.execute(async () => {
// do something
}, { maxAttempts: 3, timeout: 1000, backOffOptions: { delay: 1000, multiplier: 2 } });
console.log(result);
ProtectedhandleOptionalrecoveryCallback: RecoveryCallback<T>ProtectedinitProtectedwrapOptionalerror: Error
RetryOperations interface represents the operations for retrying a task with different options.