Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options to nest context managers in the reverse order #4

Merged
merged 6 commits into from
Nov 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove a comment from awith.py
TaiSakuma committed Nov 17, 2023
commit 9ca86c93511605996bc7f1fee901d381c078201b
16 changes: 0 additions & 16 deletions src/apluggy/_wrap/awith.py
Original file line number Diff line number Diff line change
@@ -44,20 +44,4 @@ async def call(*args: Any, **kwargs: Any) -> AsyncIterator[list]:

yield yields

# TODO: The following commented out code is an attempt to support
# `asend()` through the `gen` attribute. It only works for
# simple cases. It doesn't work with starlette.lifespan().
# When starlette is shutting down, an exception is raised
# `RuntimeError: generator didn't stop after athrow()`.

# stop = False
# while not stop:
# sent = yield yields
# try:
# yields = await asyncio.gather(
# *[ctx.gen.asend(sent) for ctx in ctxs]
# )
# except StopAsyncIteration:
# stop = True

return call