MCPcopy
hub / github.com/aio-libs/aiohttp / handler

Function handler

tests/test_py35/test_client_websocket_35.py:11–17  ·  view source on GitHub ↗
(request)

Source from the content-addressed store, hash-verified

9 items = ['q1', 'q2', 'q3']
10
11 async def handler(request):
12 ws = web.WebSocketResponse()
13 await ws.prepare(request)
14 for i in items:
15 ws.send_str(i)
16 await ws.close()
17 return ws
18
19 app, url = await create_server(proto='ws')
20 app.router.add_route('GET', '/', handler)

Callers

nothing calls this directly

Calls 4

prepareMethod · 0.95
send_strMethod · 0.95
closeMethod · 0.95
receiveMethod · 0.95

Tested by

no test coverage detected