Advanced Example w/o filtered_messages available? #177
-
I am maintaining a repo that is using asyncio-mqtt. I just noticed, that the filtered_messages is deprecated and will be removed from future versions. I changed one part of the code successfully. However, it uses also the advanced example of the old readme to cancel tasks on exit. This example has now been removed recently from the readme and I cannot find an example in the new documentation. Will there be something similar like the advanced example in upcoming versions of the documentation? I was not able to find any similar discussion. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi Alexander, thanks for opening this discussion.
Yes, in fact it is already there: https://sbtinstruments.github.io/asyncio-mqtt/listening-without-blocking.html#listening-without-blocking Note that I understand your confusion. The advanced example suddenly vanished from out documentation/readme/examples without a migration guide. If you are up for it, I'd gladly review a PR that adds a migration guide to the documentation that shows how to move from |
Beta Was this translation helpful? Give feedback.
Hi Alexander, thanks for opening this discussion.
Yes, in fact it is already there: https://sbtinstruments.github.io/asyncio-mqtt/listening-without-blocking.html#listening-without-blocking
asyncio.TaskGroup
replacesasyncio.gather
along with all the manual tracking and housekeeping of individual tasks. Basically,asyncio.TaskGroup
maintains thetasks
list from the advanced example and ensures proper cancellation (I'm simplifying a lot here―there is a lot more toasyncio.TaskGroup
behind the scenes).N…