예제 #1
0
 async def app(websocket: WebSocket) -> None:
     values, errors, _ = await solve_dependencies(
         request=websocket, dependant=dependant
     )
     if errors:
         await websocket.close(code=WS_1008_POLICY_VIOLATION)
         raise WebSocketRequestValidationError(errors)
     assert dependant.call is not None, "dependant.call must me a function"
     await dependant.call(**values)
예제 #2
0
 async def app(websocket: WebSocket) -> None:
     solved_result = await solve_dependencies(
         request=websocket,
         dependant=dependant,
         dependency_overrides_provider=dependency_overrides_provider,
     )
     values, errors, _, _2, _3 = solved_result
     if errors:
         await websocket.close(code=WS_1008_POLICY_VIOLATION)
         raise WebSocketRequestValidationError(errors)
     assert dependant.call is not None, "dependant.call must be a function"
     await dependant.call(**values)