def update_callback(self, handle, events):
        """Update the event mask for a callback."""
        if self._poll is None:
            raise RuntimeError('poll instance is closed')
        if not has_callback(self, handle):
            raise ValueError('no such callback')
        if events & ~(READABLE|WRITABLE):
            raise ValueError('illegal event mask: {}'.format(events))
        if handle.extra == events:
            return
        if handle.extra & READABLE:
            self._readers -= 1
        if handle.extra & WRITABLE:
            self._writers -= 1
        if events & READABLE:
            self._readers += 1
        if events & WRITABLE:
            self._writers += 1
        handle.extra = events
        self._sync()
def update_callback ( self , handle , events ) : if self . _poll is None : raise RuntimeError ( 'poll instance is closed' ) if not has_callback ( self , handle ) : raise ValueError ( 'no such callback' ) if events & ~ ( READABLE | WRITABLE ) : raise ValueError ( 'illegal event mask: {}' . format ( events ) ) if handle . extra == events : return if handle . extra & READABLE : self . _readers -= 1 if handle . extra & WRITABLE : self . _writers -= 1 if events & READABLE : self . _readers += 1 if events & WRITABLE : self . _writers += 1 handle . extra = events self . _sync ( )
Update the event mask for a callback.