0

As I understand from shiny documentation, anytime a widget gets changes in the side panel of UI, server recomputes and sends the plots (etc) to main panel in UI.

However, in my case UI needs to respond to new data coming from outside (java code is reading from socket on a thread). I believe input argument to shiny server is coming from UI and cannot be altered to come from other R or Java (pl correct me if I am wrong). So I am thinking of appending the new data to a file and shiny server can periodically read this file and recompute the graphs

1)How can I ensure that my shiny server repeatedly gets called ? can I do something in sidepanel of UI to periodically invoke shiny server or can I loop in shiny server with delay(similar to java for loop) 2)Assuming above (1) can be done, can I write what ever R code I want in shiny server (like reading data from file); are there any limitations on what code goes into shiny server

kashili kashili
  • 955
  • 4
  • 15
  • 31
  • 2
    I'm not sure if I understand what you want but the `reactiveTimer` in shiny might be something to look into – Dason Feb 28 '14 at 04:55
  • 1
    reactiveTimer is one possibility. more generally, you can define server side reactive values, and every output widget that relies on these values will get re-evaluated everytime one of those values changes. These values can be changed by anything (another session, a background process, etc.) and not only by the user. – amit Feb 28 '14 at 11:08
  • 1
    @Dason amit -thx guys; also working code using reactiveTimer at http://stackoverflow.com/questions/18302579/r-shiny-update-graph-plot-with-fixed-interval-of-time?rq=1 – kashili kashili Mar 01 '14 at 17:31
  • Does this answer your question? [Update graph/plot with fixed interval of time](https://stackoverflow.com/questions/18302579/update-graph-plot-with-fixed-interval-of-time) – Jan Feb 07 '21 at 16:52

0 Answers0