Shiny's async capability (using {promises} and {future}) is really great for allowing multiple users to share one shiny app session. When one user is waiting for a long computation, only that user is blocked while other users are still able to continue to use the app.
I recently tested the following simple app. Locally it works as expected: if I open multiple browser sessions, they don't wait for each other. But when deployed to shinyapps.io, that doesn't seem to work. Can async work in shinyappsio?
library(shiny)
library(promises)
library(future)
plan(multisession)
ui <- fluidPage(
numericInput("num", "num", 5),
"Double: ",
textOutput("text", inline = TRUE)
)
server <- function(input, output, session) {
output$text <- renderText({
num <- input$num
future_promise({
Sys.sleep(3)
num * 2
})
})
}
shinyApp(ui, server)