synchronise | R Documentation |
Evaluate an expression in an async phase. It creates an event loop, then evaluates the supplied expression. If its result is a deferred value, it keeps running the event loop, until the deferred value is resolved, and returns its resolved value.
synchronise(expr)
expr |
Async function call expression. If it does not evaluate to a deferred value, then it is just returned. |
If an error is not handled in the async phase, synchronise()
will
re-throw that error.
synchronise()
cancels all async processes on interrupt or external
error.
http_status <- function(url, ...) {
http_get(url, ...)$
then(function(x) x$status_code)
}
synchronise(http_status("https://eu.httpbin.org/status/418"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.