Skip to content

Instantly share code, notes, and snippets.

@andrewthetechie
Created February 6, 2018 01:18
Show Gist options
  • Save andrewthetechie/15ec9bb90fb022b2f720170f27d3cdef to your computer and use it in GitHub Desktop.
Save andrewthetechie/15ec9bb90fb022b2f720170f27d3cdef to your computer and use it in GitHub Desktop.
from threading import RLock
from wrapt import synchronized # https://stackoverflow.com/a/29403915
# These locks are for our synchronized decorator
_WATCHDOG_LOCK = RLock()
@synchronized(_WATCHDOG_LOCK)
def watchdog(self):
self.log.debug("watchdog called")
def activate(self):
self.start_poller(150, self.watchdog, None)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment