MCPcopy
hub / github.com/psycopg/psycopg / notifier

Function notifier

tests/test_notify_async.py:59–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57 npid = None
58
59 async def notifier():
60 async with await aconn_cls.connect(dsn, autocommit=True) as nconn:
61 nonlocal npid
62 npid = nconn.pgconn.backend_pid
63
64 await asleep(0.25)
65 await nconn.execute("notify foo, '1'")
66 await asleep(0.25)
67 await nconn.execute("notify foo, '2'")
68
69 async def receiver():
70 await aconn.set_autocommit(True)

Callers

nothing calls this directly

Calls 4

asleepFunction · 0.70
connectMethod · 0.45
executeMethod · 0.45
transactionMethod · 0.45

Tested by

no test coverage detected