Execute the callback function with the given options.
The type of the return value of the callback function.
The callback function to execute.
Optionaloptions: RetryOptions<T>
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);
RetryOperations interface represents the operations for retrying a task with different options.