def run(command, delay=.01, loop=0): ''' helper function: loop through SERVER/TIMER until command.is_done is True ''' while not command.is_done: SERVER.service(delay=delay, max_iterations=loop) TIMERS.service()
def __init__(self, socket, context): context.timer = TIMERS.add(context.timeout * 1000.0, self.on_timeout, onetime=True).start() super(_Handler, self).__init__(socket, context) if context.recv_len is not None: self.RECV_LEN = context.recv_len