| async_evaluators | R Documentation |
These functions support async request handling. You can register your own as
well using register_async().
mirai_async(...)
... |
Further argument passed on to the internal async function. See Details for information on which function handles the formatting internally in each async evaluator |
A function taking expr and envir. The former is the expression to
evaluate and the latter is an environment with additional variables that
should be made available during evaluation
mirai_async() uses mirai::mirai(). It is registered as
"mirai". Be aware that for this evaluator to be performant you should
start up multiple persistent background processes. See mirai::daemons().
# Use the default mirai backend by setting `async = TRUE` with a handler
pa <- api() |>
api_get("/hello/<name:string>", function(name) {
list(
msg = paste0("Hello ", name, "!")
)
}, async = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.