async (version 0.0.0.9004)

async_retryable: Make an asynchronous funcion retryable

Description

Make an asynchronous funcion retryable

Usage

async_retryable(task, times)

Arguments

task

An asynchronous function.

times

Number of tries.

Value

Asynchronous retryable function.

See Also

Other async control flow: async_reflect, async_retry, async_sequence, async_try_each, async_until, async_whilst

Examples

Run this code
# NOT RUN {
## 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)
# }

Run the code above in your browser using DataCamp Workspace