Hi @mabo The first thing I will quickly note is that kind of usage, where you call stream
from outside the bokeh server, from a separate process, is not really intended usage.[1] In fact, I am somewhat surprised it works in any fashion. In any case, connecting this way has a number of intrinsic disadvantages, including doubling both the storage required for any data (since its now duplicated in the outside process, and the bokeh server), as well as adding an entire additional network leg between the data and the browser (between the outside process and the bokeh server). This kind of approach is explicitly dis-encouraged by the developers of Bokeh.
So, I would first suggest trying to reorganized things so that all the logic is in the bokeh server app, perhaps using a periodic callback in place of the loop.
Alternatively, you might look at AjaxDataSource
or ServerSentDataSource
. Given that you are not actually relying on any real Python callbacks, using one of those would allow you to avoid running a Bokeh server at all.
-
The intended usage of
bokeh.client
is to make one time tweaks/changes to a session. e.g. to customize a Bokeh app that is embedded in a Flask app on a per-user basis, before the user sees it. ↩︎