Releases: community-of-python/stompman
Releases · community-of-python/stompman
1.0.1
Changed API, reconnects
What's Changed
Before:
async with client.enter_transaction() as transaction: await client.send(body=b"hi there!", destination="DLQ", transaction=transaction, headers={"persistent": "true"})After:
async with client.begin() as transaction: await transaction.send(body=b"hi there!", destination="DLQ", headers={"persistent": "true"})
- Now, client starts listening to messages the moment you enter the async-with block (async with stompman.Client() as client). Previously it happened only when async for event in Client.listen(): ... was executed. Client.listen() and "events" are removed.
- To handle ERROR frames and heart-beats, pass handlers to Client().
- To subscribe to destinations: subscription = await Client.subscribe(destination, handler) (note that it is not a context manager anymore). To unsubscribe: await subscription.unsubscribe().
- Client will block at end of async-with block if there are any active subscriptions.
See the README.md for more.
Before:
async with asyncio.TaskGroup() as task_group, client.subscribe("DLQ"): async for event in client.listen(): match event: case stompman.MessageEvent(body=body): task_group.create_task(event.with_auto_ack(handle_message(body), on_suppressed_exception=print))After:
await client.subscribe("DLQ", handle_message)(and listening happens in background)
Before,
stompman.ConnectionLostError
was raised each time connection had lost. Now, client will attempt to reconnect, if it fails,stompman.FailedAllConnectAttemptsError
will be raised. There's alsostompman.RepeatedConnectionLostError
for case when connection gets lost when trying to do a single operation like send a frame.
I expect the client to have much more stable behavior after this change.
Maintenance
- Make use of uv run --frozen by @vrslev in #40
- Update README.md by @vrslev in #41
- Bump astral-sh/uv from 0.2.27 to 0.2.31 by @dependabot in #44
New Contributors
- @dependabot made their first contribution in #44
Full Changelog: 0.8.0...1.0.0
0.8.0
What's Changed
- Add property testing for and fix issues regarding ser-de by @vrslev in #27
- Refactor ser-de by @vrslev in #32
- Fixes authorization: Avoid escaping headers in CONNECT frame by @vrslev in #37
- Show received frames in ConnectionConfirmationTimeoutError by @vrslev in #38
- Maybe breaking: Set frozen, kw_only, slots to dataclasses when possible by @vrslev in #39
Maintenance
- Update ruff config by @vrslev in #33
- Use uv docker image by @vrslev in #34
- Unpin uv by @vrslev in #35
Full Changelog: 0.7.1...0.8.0