yihui/servr

servr::rmdv2 is blocking ?

statquant opened this issue · 1 comments

Hello, I might have misunderstood but it seems running servr::rmdv2(host = "0.0.0.0", browser = FALSE, daemon = TRUE) is blocking the terminal it has been run in.

The following repex blocks when wait: TRUE (sorry I do not know how to escape the ` properly in github)
Is it normal behavior, I would expect the kniting to be done on a background thread ?

---
title: "My First R Markdown Document"
author: "Author: Your Name"
date: "Last update: `r format(Sys.time(), '%d %B, %Y')`"
output: html_document
params:
 wait: TRUE
---
Hello
\```{r, echo = params$wait, eval = params$wait}
Sys.sleep(15)
\```
Good bye

I run R 4.0.2 on centos7
I've made the following video to illustrate

servr

yihui commented

Knitting is done in another R session via system2('Rscript', c('-e', 'rmarkdown::render("input.Rmd")')), which blocks your current R session.