v0.5.0
版本发布时间: 2024-02-10 03:29:48
frankie567/httpx-ws最新发布版本:v0.6.0(2024-04-05 14:43:49)
Bump version 0.4.3 → 0.5.0
New features
Breaking changes
-
WebSocketSession
andAsyncWebSocketSession
are now context managers. If you were using them directly instead of relying onconnect_ws
andaconnect_ws
, you'll have to adapt your code accordingly:
with WebSocketSession(...) as session:
...
async with AsyncWebSocketSession(...) as session:
...
-
AsyncWebSocketSession.receive_*
methods may now raiseTimeoutError
instead ofasyncio.TimeoutError
:
Before
try:
event = await ws.receive(timeout=2.)
except asyncio.TimeoutError:
print("No event received.")
except WebSocketDisconnect:
print("Connection closed")
After
try:
event = await ws.receive(timeout=2.)
except TimeoutError:
print("No event received.")
except WebSocketDisconnect:
print("Connection closed")
1、 httpx_ws-0.5.0-py3-none-any.whl 12.61KB
2、 httpx_ws-0.5.0.tar.gz 21.23KB