When I start an R
script that runs a shiny
app from the cmd
line, it appears to launch two instances of Rscript.exe
? I can always kill the smaller of the two and the app continues to run? Can someone elaborate on what is actually going on behind the scenes or tell me what I am doing wrong that is creating double processes?
super_simple.R
require(shiny)
app <- shinyApp(
ui = bootstrapPage(
numericInput('n', 'Number of obs', 100),
plotOutput('plot')
),
server = function(input, output) {
output$plot <- renderPlot({ hist(runif(input$n)) })
}
)
runApp(app, launch.browser = FALSE, port = 1234, host = "10.123.4.56")
Now if I launch this via the cmd
line:
START Rscript --vanilla C:\Users\Jason\Projects\super_simple.R
At this point, I can point my browser to http://10.123.4.56:1234
and see the app. However, if I look at my running processes via: tasklist /FI "imagename eq rscript*"
I see two Rscript.exe
processes:
What I've determined, however, is that I can always kill the smaller of the two (e.g., taskkill /pid 9360 /f
) and yet the app still functions in its entirety? NOTE: I have tried starting the command in the background via START \b ...
but the outcome is the same.