Skip to content

Commit

Permalink
Merge pull request #98 from jcheng5/patch-1
Browse files Browse the repository at this point in the history
Move shiny::onStop in vignette
  • Loading branch information
shikokuchuo committed Mar 14, 2024
2 parents e86299f + 8859624 commit 36b5417
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions vignettes/shiny.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ server <- function(input, output, session) {
output$result <- renderPlot(reactive_result(), height = 600, width = 600)
output$status <- renderText(reactive_status())
poll_for_results <- reactiveVal(FALSE)
# automatically shutdown daemons when app exits
onStop(function() daemons(0L))
# create empty mirai queue
q <- list()
Expand Down Expand Up @@ -98,6 +95,8 @@ server <- function(input, output, session) {
# mirai setup - 5 local daemons with dispatcher
# switch off cleanup as not necessary (each task is self-contained)
daemons(5L, cleanup = FALSE)
# automatically shutdown daemons when app exits
onStop(function() daemons(0L))
# pre-load function on each daemon for efficiency
everywhere(run_task <<- run_task, .args = list(run_task))
Expand Down

0 comments on commit 36b5417

Please sign in to comment.