This repository was archived by the owner on Mar 20, 2023. It is now read-only.
This repository was archived by the owner on Mar 20, 2023. It is now read-only.
[Feature request] AsyncElasticsearch should implement an async context manager #48
Closed
Description
It would be nice if AsyncElasticsearch
implemented the magic methods (specifically __aenter__()
and __aexit__()
) to become an async context manager, which would allow code like this:
async with AsyncElasticsearch() as client:
print(await client.info())
and have the session closed.
Happy to implement this similar to how aiohttp has done it if you are interested!
Metadata
Metadata
Assignees
Labels
No labels