Skip to content

Commit

Permalink
Make PeriodicCallback.period dynamically updatable (#609)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored Aug 21, 2019
1 parent 7484636 commit de6e06d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions panel/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ def start(self):
self._cb = PeriodicCallback(self._periodic_callback, self.period)
self._cb.start()

@param.depends('period', watch=True)
def _update_period(self):
if self._cb:
self.stop()
self.start()

def _periodic_callback(self):
self.callback()
self._counter += 1
Expand Down

0 comments on commit de6e06d

Please sign in to comment.