I would appreciate help in understanding something relating to multiple users on the same shiny app at one time, and whether shinyproxy can solve my issue.
Suppose the following shiny app:
library(shiny)
shinyApp(
ui = pageWithSidebar(
headerPanel("actionButton test"),
sidebarPanel(
numericInput("n", "N:", min = 0, max = 100, value = 50),
br(),
actionButton("goButton", "Go!"),
p("Click the button to update the value displayed in the main panel.")
),
mainPanel(
verbatimTextOutput("nText")
)
),
server = function(input, output) {
ntext <- eventReactive(input$goButton, {
## SLEEP for 10 seconds after every submit
Sys.sleep(10)
input$n
})
output$nText <- renderText({
ntext()
})
}
)
I am simulating a “long running” process with the Sys.sleep
function. What I notice is that when I run this shiny app, if I click submit and then open a new window to that shiny app, the new window will not load until the first one has finished (e.g. after 10 seconds).
Can I deploy this shiny app with shinyproxy and avoid this problem where user 2 waits for user 1’s calculation to finish before anything happens?
Thank you in advance