async_until | R Documentation |
TRUE
Repeatedly call task until it its test function returns TRUE
async_until(test, task, ...)
test |
Synchronous test function. |
task |
Asynchronous function to call repeatedly. |
... |
Arguments to pass to |
Deferred value, that is resolved when the iteration is done.
Other async control flow:
async_backoff()
,
async_reflect()
,
async_retry()
,
async_retryable()
,
async_sequence()
,
async_try_each()
,
async_whilst()
## Keep calling until it "returns" a number less than < 0.1
calls <- 0
number <- Inf
synchronise(async_until(
function() number < 0.1,
function() {
calls <<- calls + 1
number <<- runif(1)
}
))
calls
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.