def __init__(self, map=None): self.closing = False self._eventfd = EventFD() try: asyncore.file_dispatcher.__init__(self, self._eventfd.fileno(), map=map) except: self._eventfd.close() raise
class AsyncoreEvent(asyncore.file_dispatcher): def __init__(self, map=None): self.closing = False self._eventfd = EventFD() try: asyncore.file_dispatcher.__init__( self, self._eventfd.fileno(), map=map ) except: self._eventfd.close() raise def writable(self): return False def set(self): self._eventfd.write(1) def handle_read(self): self._eventfd.read() def close(self): if self.closing: return self.closing = True try: self._eventfd.close() except (OSError, IOError): pass asyncore.file_dispatcher.close(self)
def __init__(self, map=None): self.closing = False self._eventfd = EventFD() try: asyncore.file_dispatcher.__init__( self, self._eventfd.fileno(), map=map ) except: self._eventfd.close() raise