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

Function client

example/faq/shutdown_client.py:8–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6from websockets.asyncio.client import connect
7
8async def client():
9 async with connect("ws://localhost:8765") as websocket:
10 # Close the connection when receiving SIGTERM.
11 loop = asyncio.get_running_loop()
12 def close():
13 return loop.create_task(websocket.close())
14 loop.add_signal_handler(signal.SIGTERM, close)
15
16 # Process messages received on the connection.
17 async for message in websocket:
18 ...
19
20asyncio.run(client())

Callers 1

shutdown_client.pyFile · 0.70

Calls 1

connectFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…