Make an asynchronous funcion retryable
async_retryable(task, times)
Asynchronous retryable function.
Other async control flow:
async_backoff()
,
async_reflect()
,
async_retry()
,
async_sequence()
,
async_try_each()
,
async_until()
,
async_whilst()
# \donttest{
## Create a downloader that retries five times
http_get_5 <- async_retryable(http_get, times = 5)
ret <- synchronise(
http_get_5("https://eu.httpbin.org/get?q=1")$
then(function(x) rawToChar(x$content))
)
cat(ret)
#> {
#> "args": {
#> "q": "1"
#> },
#> "headers": {
#> "Accept": "*/*",
#> "Accept-Encoding": "deflate, gzip, br, zstd",
#> "Host": "eu.httpbin.org",
#> "User-Agent": "R/4.5.1 R (4.5.1 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions",
#> "X-Amzn-Trace-Id": "Root=1-689f5c99-697d0f8c7ed5e50479f25ed3"
#> },
#> "origin": "172.174.167.21",
#> "url": "https://eu.httpbin.org/get?q=1"
#> }
# }