def __init__(self):
    self.clients = []
self.lc = task.LoopingCall(self.announce)
self.lc.start(10)

def announce(self):
    for client in self.clients:
        client.transport.write('10 seconds has passed\n')

def clientConnectionMade(self, client):
    self.clients.append(client)

def clientConnectionLost(self, client):
    pass
Running a function periodically in twisted protocol