I have two separate bokeh server applications running on separate hosts in our network.
- Measurement.py, which
- provides control of a data acquisition system
- displays the acquired raw data
- save the raw data to a database and appends new data, when available
- can start-up Analysis.py with a database link as request-argument in new browser window
- Analysis.py which:
- can open a database link given as request-argument to access raw data
- display the raw data (again)
- make an in depth analysis (fitting, statistics etc.) of the data
- reload updated raw data sets from the same data base link
Now, it would be nice to have the capability to send an (asynchronous inter-process communication (IPC)) message from Measurement.py to Analysis.py, whenever the raw-data has been updated.
Analysis.py could then reload the data and progress with the analysis.
The rabbit hole I went down into was the idea to use a websocket between the two processes.
However, the combination of the usual asyncio examples for general websockets with the challenge of an already running “tornado.IOloop” in the bokeh servers is beyond my comprehension.
The more I read the more confused I get.
Hence my question is:
Is there some example code on how to setup an additional websocket (server, client) in a bokeh server application and “await” a message on that websocket from an external application?
Note 1: If there is a simpler solution to accomplish this IPC task, I would be happy about suggestions, too.
Note 2: Of course Analysis.py could poll the data base for changes, but that’s only the last resort, here.
Note 3: I think this here probably points in a good direction, but raises more questions to me than answers.
Any input is welcome.

