Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.2k views
in Technique[技术] by (71.8m points)

R Shiny - call multiple observe() invalidateLater() functions

What I would like to do is have two or more automated functions handled by observe() and kicked off by invalidateLater().This would be inside the server block, as example a clock that 1 fires every second and another function that grabs a large data set and takes like a minute to process. How to keep the clock ticking?

 clock1() <- reactiveTimer(intervalMs = 1000, session)
 observe({
     clock1()
 })
  output$time1 <- renderText({
    clock1()
    paste0(as.character(strptime(Sys.time(), format = "%Y-%m-%d %H:%M:%S", tz = "EST")))
  })

 bigData <- reactiveVal()
 observe({
    invalidateLater(milliseconds = 10000)
    isolate(bigData(getBigData()))
 })
  
  output$bigD <- render_htmlTable({
     bigData %>% filter()
  })

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...