async_retryable: Make an asynchronous funcion retryable

View source: R/retry.R

async_retryableR Documentation

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_backoff(), async_reflect(), async_retry(), async_sequence(), async_try_each(), async_until(), async_whilst()

Examples


## 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)


r-lib/async documentation built on March 24, 2024, 6:20 p.m.