async_retry | R Documentation |
Keeps trying until the function's deferred value resolves without
error, or times
tries have been performed.
async_retry(task, times, ...)
task |
An asynchronous function. |
times |
Number of tries. |
... |
Arguments to pass to |
Deferred value for the operation with retries.
Other async control flow:
async_backoff()
,
async_reflect()
,
async_retryable()
,
async_sequence()
,
async_try_each()
,
async_until()
,
async_whilst()
## Try a download at most 5 times
afun <- async(function() {
async_retry(
function() http_get("https://eu.httpbin.org"),
times = 5
)$then(function(x) x$status_code)
})
synchronise(afun())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.