We would like to know the best possible way to launch all this queries at the same time, when the user press click:
con_saf_17 <- DBI::dbConnect(odbc::odbc(),.connection_string = paste0("Driver={ODBC Driver 17 for SQL Server};Server=", safectado_pro[1], ",", safectado_pro[2], ";Database=",safectado_pro[3], ";UID=", safectado_pro[4], ";PWD=", safectado_pro[5]))
consulta_saf <- function(query){
t_ini <- now()
tib <- dbGetQuery(con_saf_17,query)
t_fin <- now()
tiempo <- round(t_fin - t_ini, 2)
list(tib = tib, tiempo = tiempo,t_ini=t_ini, t_fin=t_fin)
}
b <- eventReactive(input$click,{consulta_saf(consulta_sf_btp)})
c<- eventReactive(input$click,{consulta_saf(c_saf_voz)})
a <- eventReactive(input$click,{consulta_saf(consulta_sf_inc)})