Executes an async function with automatic retries.
The async function to execute.
Retry configuration options.
The result of the function if successful.
Implements exponential backoff between retry attempts. Errors are silently retried up to maxAttempts times before being thrown.
The last error if all attempts fail.
Executes an async function with automatic retries.