(receive: Receive, send: Send)
| 275 | await websocket.send_json({"message": "test"}) |
| 276 | |
| 277 | async def asgi(receive: Receive, send: Send) -> None: |
| 278 | websocket = WebSocket(scope, receive=receive, send=send) |
| 279 | await websocket.accept() |
| 280 | async with anyio.create_task_group() as task_group: |
| 281 | task_group.start_soon(respond, websocket) |
| 282 | try: |
| 283 | # this will block as the client does not send us data |
| 284 | # it should not prevent `respond` from executing though |
| 285 | await websocket.receive_json() |
| 286 | except WebSocketDisconnect: |
| 287 | pass |
| 288 | |
| 289 | return asgi |
| 290 |
nothing calls this directly
no test coverage detected