Why launch a brilliant run of two Rscript processes on Windows when starting from cmd line?

When I run a Rscript that launches the application shinyfrom a line cmd, does it launch two instances Rscript.exe? Can I always kill the smaller of the two and the application continues to work? Can someone clarify what really happens behind the scenes or tell me what I'm doing wrong, which creates 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 ran this through the line cmd:

START Rscript --vanilla C:\Users\Jason\Projects\super_simple.R

At this point, I can point the browser to http://10.123.4.56:1234and see the application. However, if I look at my running processes through:, tasklist /FI "imagename eq rscript*"I see two processes Rscript.exe:

The processes

, (, taskkill /pid 9360 /f), ? . START \b ..., .

+4
1

R- (Rscript.exe, R.exe, Rcmd.exe) Shiny. Rterm.exe .

Rscript.exe --verbose, , :

> Rscript --verbose script.R
running
  'C:\PROGRA~1\R\R-34~1.0\bin\x64\Rterm.exe --slave --no-restore --file=script.R'

, .

.

+2

Source: https://habr.com/ru/post/1690287/


All Articles