2

I have access to a plumber API which handles some automatic pipelining workflows for me. However, every job runs on the same R session and I'm a bit concerned regarding different calls interfering with each other.

Off to top of my head the wish is that every call starts on a fresh R session. When regularly programming in R I would just restart the session and have a clean setup but with the plumber server this seems to be "not so easy". Some reading also revealed that "cleaning up" your R session without a restart isn't a straight forward thing.

Of course I'm also open to alternative suggestions. Any suggestions and insights are welcome. In the end I would simply like the API calls to return the same thing if the inputs are the same.

zx8754
  • 52,746
  • 12
  • 114
  • 209
Patrick
  • 742
  • 7
  • 19
  • 1
    What about library(RestRserve)? – SBMVNO Jan 30 '23 at 08:23
  • do you mean just cleaning the work environment? if so, you could write ```rm(list=ls())``` , but this just cleans your datasets off, so you need to reload whichever dataset you are interested in working in – Andy Jan 30 '23 at 08:33
  • Its more about packages than data but generally a vanilla starting point for every call is what I'm looking for. – Patrick Jan 30 '23 at 08:36
  • I think you need to provide an example - with some code - of what exactly persists between calls, and the type of API requests this occurs with, i.e. `GET`, `PUT`, `POST`. Not all requests are required to be idempotent but of those that should be, I'm having difficulty imagining what non-data package-related information is causing an issue. – SamR Jan 30 '23 at 08:40
  • 1
    Would ‘callr’ be appropriate for you? – Konrad Rudolph Jan 30 '23 at 08:41
  • The `callr` library suggestion was very helpful thank you! I'll try and write some sort of code snippet showing how I used it when finished. – Patrick Feb 07 '23 at 16:53

0 Answers0