Delayed execution in R Shiny app

后端 未结 1 524
礼貌的吻别
礼貌的吻别 2021-02-15 02:46

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:12
    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)
提交回复
热议问题