Skip to content

Commit

Permalink
Ensure that Stream triggering state is handled correctly on bokeh ser…
Browse files Browse the repository at this point in the history
…ver (#4041)
  • Loading branch information
philippjfr committed Oct 8, 2019
1 parent 2867d4a commit 7813f58
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion holoviews/plotting/bokeh/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,23 @@ def _construct_callbacks(self):

def refresh(self, **kwargs):
if self.renderer.mode == 'server' and curdoc() is not self.document:
self._triggering += [s for p in self.traverse(lambda x: x, [Plot])
for s in p.streams if s._triggering]
# If we do not have the Document lock, schedule refresh as callback
self.document.add_next_tick_callback(self.refresh)
else:
return

for s in self._triggering:
s._triggering = True
try:
super(BokehPlot, self).refresh(**kwargs)
except Exception as e:
raise e
finally:
# Reset triggering state
for s in self._triggering:
s._triggering = False
self._triggering = []

def push(self):
"""
Expand Down

0 comments on commit 7813f58

Please sign in to comment.