Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timers not getting reaped #1278

Closed
jcheng5 opened this issue Aug 9, 2016 · 0 comments · Fixed by #1284
Closed

timers not getting reaped #1278

jcheng5 opened this issue Aug 9, 2016 · 0 comments · Fixed by #1284
Assignees

Comments

@jcheng5
Copy link
Member

jcheng5 commented Aug 9, 2016

Run the below, then un-comment the invalidateLater and run again, then comment it again and run once more. You'll find that the log messages are only printed once for the first run, many times for the second and third runs. This indicates that timerCallbacks$executeElapsed() continues to find things to do even after the second app is done running.

library(shiny)

ui <- fluidPage(
  textOutput("txt")
)

server <- function(input, output, session) {
  rv <- reactiveValues(x = 0)

  output$txt <- renderText({
    # invalidateLater(1000)
    print("rendering text")
    as.character(rv$x)
  })

  session$onFlushed(function() {
    print("onFlushed.")
    rv$x <- isolate(rv$x) + 1
  }, once = FALSE)
}

shinyApp(ui, server, options = list(launch.browser = paneViewer()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants