Remove a handler; drops the session subscription with the last one.
(self, callback_id: int)
| 364 | return callback_id |
| 365 | |
| 366 | def remove_handler(self, callback_id: int) -> None: |
| 367 | """Remove a handler; drops the session subscription with the last one.""" |
| 368 | conn = self._script._conn |
| 369 | conn.remove_callback(_EventRef(self.EVENT), callback_id) |
| 370 | with self._lock: |
| 371 | removed = self._categories.pop(callback_id, None) |
| 372 | if removed is not None and not self._categories: |
| 373 | _unsubscribe_from_event(conn, self.EVENT, self._subscription_id) |
| 374 | self._subscription_id = None |
| 375 | |
| 376 | def clear_handlers(self, category: str) -> None: |
| 377 | """Remove every handler registered under ``category``.""" |
no test coverage detected