How do you set the priority at which calculations are performed reactive()in Shiny? For example, there is an option priorityin observe()quoting the help file
priority
An integer or numeric that controls the priority with which this observer
should be executed. An observer with a given priority level will always execute
sooner than all observers with a lower priority level. Positive, negative,
and zero values are allowed.
I want to apply this if my Shiny toolbar displays some summary statistics before writing these statistics to the logging database, here is an example
To server.Rretrieve data every hour
observe({
invalidateLater(3600000,session)
con <- dbConnect(PostgreSQL(), ...)
values$data = dbGetQuery(con, "select * from table;")
})
output$text = renderText({
temp = values$data
print(paste("the mean is", mean(temp)))
})
observe({
temp = values$data
dbWriteTable(con, paste0("Insert into table_means Values (", (mean(temp),");" ))
})
And in ui.RI print the average of the data.
I want UI rendering to happen before writing values to my sql database
Here are some related questions :
R shiny , Null