async_timeout | R Documentation |
If the deferred value is not resolved before the timeout expires,
async_timeout()
throws an async_timeout
error.
async_timeout(task, timeout, ...)
task |
Asynchronous function. |
timeout |
Timeout as a |
... |
Additional arguments to |
A deferred value. An async_timeout
error is thrown if it is
not resolved within the specified timeout.
## You can catch the error, asynchronously
synchronise(
async_timeout(function() delay(1/10)$then(function() "OK"), 1/1000)$
catch(async_timeout = function(e) "Timed out",
error = function(e) "Other error")
)
## Or synchronously
tryCatch(
synchronise(
async_timeout(function() delay(1/10)$then(function() "OK"), 1/1000)
),
async_timeout = function(e) "Timed out. :(",
error = function(e) paste("Other error:", e$message)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.