Register a callable to be invoked whenever a notification is received. :param callback: the callback to call upon notification received. :type callback: Callable[[~psycopg.Notify], None]
(self, callback: NotifyHandler)
| 353 | logger.exception("error processing notice callback '%s': %s", cb, ex) |
| 354 | |
| 355 | def add_notify_handler(self, callback: NotifyHandler) -> None: |
| 356 | """ |
| 357 | Register a callable to be invoked whenever a notification is received. |
| 358 | |
| 359 | :param callback: the callback to call upon notification received. |
| 360 | :type callback: Callable[[~psycopg.Notify], None] |
| 361 | """ |
| 362 | self._notify_handlers.append(callback) |
| 363 | |
| 364 | def remove_notify_handler(self, callback: NotifyHandler) -> None: |
| 365 | """ |
no outgoing calls