$ the-wire · showcase
Django wraps async iteration in aclosing
By RepoJournal · Filed · About Django · Composed from the cited sources · methodology
Django's async consumption sites now close their iterators deterministically instead of waiting on asyncio's asyncgen finalizer hook, with the fix landing as ticket-37066 for 6.2.
Fixed #37066 -- Wrapped async iteration sites in (maybe_)aclosing. django/django
Every site that runs a bare `async for` over an iterable it did not define locally is now inside `async with (maybe_)aclosing(aiter(...)) as it: async for item in it:`, so aclose() runs the moment the consumer exits rather than being deferred to asyncio's asyncgen finalizer hook. The commit also adds django.utils.asyncio.maybe_aclosing, a small wrapper that uses contextlib.aclosing when the ite...
Fixed #37066 -- Wrapped async iteration sites in (maybe_)aclosing. django/django
Carlton Gibson's follow-up rebases Thomas Grainger's original patch after review, bumps the version added to 6.2, moves the docs under utils and adds a release note, so the change is documented where you will look for it.
Results for ubuntu-latest added [skip ci] django/django-asv
by Github Bot
The benchmark suite picked up recorded results for ubuntu-latest, which is CI bookkeeping on django-asv rather than a change to Django itself.