Executes an asynchronous function and retries the execution if it rejects.