Hi,
I would like for there to be some mechanism for the server to be notified when the last PATCH arrives at the client, so that the server knows not to send another one. Is this possible?
The background is, I have a Bokeh server implementing a slider.on_change
callback. The idea is to use the slider value to filter which slice of data gets displayed in a plot. It is potentially a lot of data (10k points per slice, and possibly 1000 or more slices) so I chose to do this by holding all of the data in a session server side, and only sending the slice to the client.
Also, I’ve implemented a mechanism to prevent multiple on_change callbacks to be scheduled. Unfortunately, this alone is not sufficient to prevent a backlog when the slider is dragged. I think this is what’s happening:
- On the client, the slider is dragged, which emits many “on-change” events
- The server is fast enough to process each of the on-change events completely before the next one arrives.
- Each invocation of the server-side on-change handler causes a PATCH to be sent to the client.
- The PATCH messages start to overlap, causing lag.
Here you can (hopefully) see that when the slider is moved and then left alone, the updates to the plot keep rolling in. I’d like to prevent this behavior.