MCPcopy Index your code
hub / github.com/python-websockets/websockets / PubSub

Class PubSub

experiments/broadcast/server.py:29–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28
29class PubSub:
30 def __init__(self):
31 self.waiter = asyncio.get_running_loop().create_future()
32
33 def publish(self, value):
34 waiter = self.waiter
35 self.waiter = asyncio.get_running_loop().create_future()
36 waiter.set_result((value, self.waiter))
37
38 async def subscribe(self):
39 waiter = self.waiter
40 while True:
41 value, waiter = await waiter
42 yield value
43
44 __aiter__ = subscribe
45
46
47async def handler(websocket, method=None):

Callers 1

broadcast_messagesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…