async_replicate | R Documentation |
Similar to base::replicate()
, with some differences:
it takes an async function, instead of an expression, and
it always returns a list.
async_replicate(n, task, ..., .limit = Inf)
n |
Number of replications. |
task |
Async function to call. |
... |
Additional arguments to |
.limit |
Number of concurrent async processes to create. |
Resolves to a list of the results of the n
task
calls.
## perform an HTTP request three times, and list the reponse times
do <- function() {
async_replicate(3,
function() http_get("https://eu.httpbin.org")$then(function(x) x$times))
}
synchronise(do())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.