Delayed execution in R Shiny app

后端 未结 1 2164
小鲜肉
小鲜肉 2021-02-15 02:39

Is it possible have some parts of RShiny app execute in a delayed fashion much like the Delayed start in Windows Services?

Let me elaborate.

I have a shiny app

相关标签:
1条回答
  • 2021-02-15 03:26
    shinyServer(function(input, output, session) {
      values <- reactiveValues(starting = TRUE)
      session$onFlushed(function() {
        values$starting <- FALSE
      })
    
      output$fast <- renderText({ "This happens right away" })
      output$slow <- renderText({
        if (values$starting)
          return(NULL)
        "This happens later"
      })
    })
    
    0 讨论(0)
提交回复
热议问题