0

I'm pretty new to R Plumber. I'm trying to deploy an R function as an API to be able to do live calculations for a web app. I understand R is single-thread by default and, hence, Plumber inherits the same limitations to deal with requests. The R function I'm trying to deploy is not costly, but will probably be called multiple times in a single session.

I'm also quite a newbie in terms of serving/deploying web applications, but I do know how to set up an Apache server. I've noticed that Apache can receive and process multiple requests by opening new threads (I honestly consider this as a black-box, magical thing and have zero knowledge on how apache does this). Would serving the plumber API through Apache allow me to bypass the single-thread limitations?

Alternatively, would it be possible to bypass single-thread limitations by using doParallel (or something alike)?

Leitouran
  • 578
  • 3
  • 16

1 Answers1

2

RPlumber is single thread and, as such, can only work with a single request at a time. Found out that, with enough resources, you can deploy several PlumbR servers listening on different ports. It's hacky and nasty, but it got the job done.

Leitouran
  • 578
  • 3
  • 16