# vim: ts=4 et sts=4 sw=4 autoindent from threading import Thread import time from Pyro.EventService.Clients import Publisher from sndcs.Config import config class Heartbeat(Thread, Publisher): def __init__(self): Thread.__init__(self) self.setDaemon(1) Publisher.__init__(self) # Get the Pyro namespace from the config self.namespace = config.get("pyro", "namespace", "sndcs") def run(self): print "Starting Heartbeat..." while 1: self.publish(self.namespace + "_heartbeat", "ping") time.sleep(5)