MCPcopy
hub / github.com/psycopg/psycopg / add_notify_handler

Method add_notify_handler

psycopg/psycopg/_connection_base.py:355–362  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 """

Callers 6

test_notify_handlersFunction · 0.80
listenerFunction · 0.80
test_notify_handlersFunction · 0.80
listenerFunction · 0.80

Calls

no outgoing calls

Tested by 6

test_notify_handlersFunction · 0.64
listenerFunction · 0.64
test_notify_handlersFunction · 0.64
listenerFunction · 0.64