Message388059
I've quickly wanted to create a suitable solution for myself. I made a small library with a asyncio.wait_for()-like function using asyncio.wait(). The prototype worked, so I put together a small project. When I ran tox and realized that this issue with wait_for is only present on py38 and py39 (possibly py310). The wait_for does not get stuck with py36, py37 and pypy3.
The repo is a little bare bones, but you can run tox after checkout: https://github.com/Traktormaster/wait-for2
Right now the tests are set-up that they expect wait_for to get stuck so only py38 and py39 passes.
I'm pretty sure the side-effect of returning the future's result when handling cancellation is not desired. However I'm not sure how to handle it correctly. The repo holds a demo of what I suggested in the beginning of this thread (CancelledWithResultError). It works but it is limited. |
|
Date |
User |
Action |
Args |
2021-03-03 21:18:09 | nmatravolgyi | set | recipients:
+ nmatravolgyi, asvetlov, yselivanov |
2021-03-03 21:18:09 | nmatravolgyi | set | messageid: <1614806289.45.0.299347842878.issue43389@roundup.psfhosted.org> |
2021-03-03 21:18:09 | nmatravolgyi | link | issue43389 messages |
2021-03-03 21:18:09 | nmatravolgyi | create | |
|