channels
channels copied to clipboard
channel layer Flush extension: rename close to aclose?
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).
^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()
@devkral I haven't had a chance to really think about this yet, but it's on my list.