Live update by pushing from server (rather than polling or hitting reload)?

#1

I am using a Python shell to interactively run simulations and write data to a file. I have a dash app which renders a bunch of interactive plots from this data. I’d like the dash app to show new data after each run.

Dash’s Live Updating Components page gives two options:

  1. Create a dcc.Interval on the client and have it poll for changed data
  2. Set app.layout = serve_layout to force a page reload to serve a new dynamic layout

The first seems a bit loose (but I guess the check for new data could be kept light) and the second requires the user to hit reload.

So, is there a way for my python process to tell the dash server to trigger a reload? Or some other approach I’ve missed?

1 Like
#2

I posted this in response to a similar question:

#3

hot-reloading does this for development environments. Since you are saving files, I’m not sure if the hot reloader will pick up on the changes to the file unless you place them in your assets folder 📣 Announcing Hot reload.