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

channel layer Flush extension: rename close to aclose? #1975

Open
devkral opened this issue Feb 9, 2023 · 2 comments
Open

channel layer Flush extension: rename close to aclose? #1975

devkral opened this issue Feb 9, 2023 · 2 comments

Comments

@devkral
Copy link
Contributor

devkral commented Feb 9, 2023

I am not quite sure but it seems as there is a python convention to name an async close function "aclose".
For example this name is used in contextlib.aclosing.
A rename would ease to write tests or adapters for layers as we can simply reuse contextlib.aclosing.

Note: this is not a big issue. What aclosing does is easy to replicate with the close method (see python documentation).

@devkral
Copy link
Contributor Author

devkral commented Feb 14, 2023

^What aclosing does is easy to replicate with a different named close method.

Modified example

from contextlib import asynccontextmanager

@asynccontextmanager
async def aclosing_modified(thing):
    try:
        yield thing
    finally:
        await thing.close()

@carltongibson
Copy link
Member

@devkral I haven't had a chance to really think about this yet, but it's on my list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants