Description Usage Arguments Value See Also Examples
Can be used as a keepalive utility for external connections such as SSH and WebSocket, or Shiny itself; Can also be used as a watchdog to periodically check on something. This functions is thin wrapper around shiny::reactiveTimer() and shiny::observe().
1 |
seconds |
time interval in seconds |
do |
expression |
... |
any other arguments passed to shiny::observe() |
Shiny observer
[shiny::observe()]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## Not run:
every(60, {
cat("Keeping Connection Alive...\n")
ssh::ssh_exec_internal(session = my_session,
command = "whoami")
})
shinyApp(
fluidPage(
shinyjs::useShinyjs(),
actionButton("stop", "Stop"),
textInput("blinker", "Blinker Input"),
),
function(input, output, session) {
heartbeat <- shinybeats::every(1.2, {
shinyjs::toggle("blinker")
})
observeEvent(input$stop,{
heartbeat$destroy()
})
}
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.