0

My Shiny app uses two environments from where it reads data. This makes the server code looks like this:

# Define server logic required to draw a histogram
shinyServer(function(input, output, session) {

  business.env <- new.env()
  scenario.env <- new.env()

  # do stuff with business.env and scenario.env

})

This is of course a simplified view. In reality my server side function calls a whole lot of R files. One of those will create these environments, while the others will read from the created environments.

My question is the following
In the case multiple users use the app, I want each of them to have a unique version of the business.env and the scenario.env. What happens now is that if a user is working in the app, while a second one comes in, this second user will reiniate the environments. How can I resolve this issue?

N Meibergen
  • 362
  • 2
  • 14
  • I would think any variables defined in the server function should be session specific. But you are saying this is not the case? Can you provide a minimal [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) so we can verify the problem and test possible solutions? Not sure how having unique versions of these environments is different from re-initiating them based on your description. – MrFlick Apr 16 '18 at 13:59
  • I was indeed under the impression that each session would have seperate server data. However in my working version that seems not to be the case. But I will double check and provide a minimal reproducible example if needed. Thank you. – N Meibergen Apr 16 '18 at 14:04

0 Answers0