1

quite strange behaviour, no idea how to handle it - sorry the code is not reproducible, but basically on Shiny Pro i have a global variable to check what items are being processed. All users read and write from the list to avoid duplication. It is correctly placed above the Shiny Server

if (!exists("taken")) taken  = list()
shinyServer(function(input, output, session) {...

the calls to the list and updates are handled as they should (with <<-) yet it sometimes fails to scope it globally. Even when I open 2 instances for the same user not always they see the list, even less often if I open 2 different users instances. But they sometimes can see the list after few records, it just catches up. If it was every time I could understand, but not occasional. Of course when a user does not see the list they create their own instance of the list.

How do you handle a shared items list that all users update and read from? Would you just use the same method or are there any better, more fool proof concepts?

Slav
  • 469
  • 4
  • 18
  • i suggest you create an empty list `taken` globally, and just overwrite it during process later in `server` ? – parth Jun 15 '17 at 04:25
  • do you mean just add values there? I thought it would be sufficient placeholder and if 'taken' s not visible as empty shell would it make any difference if it had one row? This one should create it, isnt it? if (!exists("taken")) taken = list() – Slav Jun 15 '17 at 08:33
  • i meant somthing like [this](https://stackoverflow.com/a/20334102/6779509) ie. you can define global variables in `global.R` for global scope – parth Jun 15 '17 at 11:18
  • I started with it, but it did not work as well, so i moved above the server - no difference and from scoping perspective as well it is not relevant (as long as I do not use it in ui.r – Slav Jun 15 '17 at 20:13

0 Answers0