I want to keep reflashing until 10:05, after 10:05 I got the tplus0_dt and stop to processing invalidaterLater().
Before 10:00, tplus0_dt doesn't exist, so I need to keep reflashing until 10:05. After 10:05, it is no need to refalsh, and when the tplus0_dt becomes very lage the invalidaterLater() will effects the displaying of table1, the screen and plots go GRAY every 1 seconds so it looks like the page is dead while the updating occurs.
So how can I do to stop processing the invalidateLater() and keep showing the data after 10:05? Thanks for help! My example code were below.
require(shiny)
require(data.table)
app <- shinyApp(
server = function(input, output, session){
get_tplus0_data <- reactive({
time <- substr(as.character(Sys.time()), 12, 16)
invalidateLater(1000)
if(time >= "10:05"){
# tplus0_dt<-data.table(read.csv("/data/df_highest_after_signal.csv",header = T, sep = ",", stringsAsFactors = F))
tplus0_dt<- data.table(a = c(1, 2, 3, 4), b = c(3, 4, 5, 8))
return(tplus0_dt)
}
})
output$table1 <- renderTable({get_tplus0_data()})
},
ui = fluidPage( tableOutput("table1") )
)
runApp(app)