hi all,
I wanted to understand little bit of backend mechanism that happens when shiny applications are run.
This is a simple application (i have mentioned the steps of execution)
So what I Understand is,
- This is program containing 7 steps of execution
- This program when launched , a process is created where this application runs
- Process thus created has single thread which performs the execution
Is my understanding correct?
Is this how a program is executed. If so, how can we make this program work on multi-thread ?
ui <- fluidPage(
numericInput("x", "X", value = 5), ## Step 1
textOutput("txt"), ## Step 2
actionButton("button", "Submit") ## Step 3
)
server <- function(input, output, session) {
asd <- data.frame(Cat1 = c("A", "A", "B", "B"), Cat2 = c("x","y", "x1", "y1")) ## Step 4
# server_1(input, output, session , y1)
y1 <- reactiveValues(a = 0) ## Step 5
function1 <- function(){
y1$a = 2 * input$x
}
observeEvent(input$button,{ ## Step 6
function1()
})
output$txt <- renderText({ ## Step 7
y1$a
})
}
shinyApp(ui, server)