Message373942
From the given example, if I add "await q.aclose()" after "await q.asend(123456)" it does not leak the memory.
This is a good example showing that we should always wrap async generators with explicit "aclosing" context manager (which does not exist yet in the stdlib).
I'm already doing so by writing a custom library:
https://github.com/achimnol/aiotools/blob/ef7bf0ce/src/aiotools/context.py#L152
We may need to update the documentation to recommend explicit aclosing of async generators. |
|
Date |
User |
Action |
Args |
2020-07-19 09:05:28 | achimnol | set | recipients:
+ achimnol, terry.reedy, asvetlov, yselivanov, zkonge |
2020-07-19 09:05:28 | achimnol | set | messageid: <1595149528.23.0.455221824957.issue41229@roundup.psfhosted.org> |
2020-07-19 09:05:28 | achimnol | link | issue41229 messages |
2020-07-19 09:05:28 | achimnol | create | |
|