The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
shiny.worker
allows you to delegate heavy computation
tasks to a separate process, such that it does not freeze your Shiny
app.
::install_github("Appsilon/shiny.worker") remotes
See live example here.
Initialise your worker at the beggining of your app.
<- initialize_worker() worker
Then, in the server of your Shiny app define a promise that returns a reactive when your heavy job will be completed.
<- function(args) {
my_heavy_calculations # ...
args
}
# this reactive object is used to trigger the job start,
# but also to pass parameters to the function
<- reactive({
reactive_arguments $start
inputlist(r = rnorm(1))
})
# resultPromise will be a reactive value with results returned by my_heavy_calculations
<- worker$run_job("job1", my_heavy_calculations, args_reactive = reactive_arguments)
resultPromise
resultPromise()$result # contains the result of the calculations
resultPromise()$resolved # contains flag that informs whether the job has finished or not
See more examples in the examples/
folder.
Appsilon is the Full Service Certified RStudio
Partner. Learn more at: appsilon.com or get in touch:
dev@appsilon.com
.
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.