def clearqueue(): while not eventq.empty(): try: EchoConnection.dispatch_all(eventq.get(False)) except Queue.Empty: pass tornado.ioloop.IOLoop.instance().add_callback(clearqueue)
def tick(): EchoConnection.dispatch_all(json.dumps({'time':time.time()}))