Exemplo n.º 1
0
Arquivo: ioloop.py Projeto: recoyou/t3
 def add_timeout(self, deadline, callback):
     """Calls the given callback at the time deadline from the I/O loop."""
     timeout = _Timeout(deadline, stack_context.wrap(callback))
     bisect.insort(self._timeouts, timeout)
     return timeout
Exemplo n.º 2
0
Arquivo: ioloop.py Projeto: recoyou/t3
 def add_callback(self, callback):
     """Calls the given callback on the next I/O loop iteration."""
     self._callbacks.add(stack_context.wrap(callback))
     self._wake()
Exemplo n.º 3
0
Arquivo: ioloop.py Projeto: recoyou/t3
 def add_handler(self, fd, handler, events):
     """Registers the given handler to receive the given events for fd."""
     self._handlers[fd] = stack_context.wrap(handler)
     self._impl.register(fd, events | self.ERROR)