Skip to content

Commit

Permalink
Bump version 0.4.3 → 0.5.0
Browse files Browse the repository at this point in the history
New features
------------

* `asyncio` and [Trio](https://trio.readthedocs.io/) support through [AnyIO](https://anyio.readthedocs.io/)

Breaking changes
----------------

* `WebSocketSession` and `AsyncWebSocketSession` are now context managers. If you were using them directly instead of relying on `connect_ws` and `aconnect_ws`, you'll have to adapt your code accordingly:

```py
with WebSocketSession(...) as session:
    ...

async with AsyncWebSocketSession(...) as session:
    ...
```

* `AsyncWebSocketSession.receive_*` methods may now raise `TimeoutError` instead of `asyncio.TimeoutError`:

**Before**

```py
try:
    event = await ws.receive(timeout=2.)
except asyncio.TimeoutError:
    print("No event received.")
except WebSocketDisconnect:
    print("Connection closed")
```

**After**

```py
try:
    event = await ws.receive(timeout=2.)
except TimeoutError:
    print("No event received.")
except WebSocketDisconnect:
    print("Connection closed")
```
  • Loading branch information
frankie567 committed Feb 9, 2024
1 parent f60c5d1 commit 69425c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion httpx_ws/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.4.3"
__version__ = "0.5.0"

from httpx_ws._api import (
AsyncWebSocketSession,
Expand Down

0 comments on commit 69425c6

Please sign in to comment.