--- /dev/null
+.. change::
+ :tags: feature, engine
+ :tickets: 9698
+
+ :func:`.aclose` have been added to :class:`_asyncio.AsyncConnection`
+ and :class:`_asyncio.AsyncSession`.
+ :func:`.aclose` is a synonym for :func:`.close`
+ that is compatible with context managers such as ``@contextlib.aclosing``
+ Patch by Grigoriev Semyon.
\ No newline at end of file
await greenlet_spawn(self._proxied.close)
async def aclose(self) -> None:
- """Call the close() method of :class:`_asyncio.AsyncConnection`"""
+ """This method is a synonym for :func:`.close`
+
+ This method is needed for compatibility with context managers,
+ such as ``@contextlib.aclosing``
+
+ .. versionadded:: 2.0.20
+ """
await self.close()
async def exec_driver_sql(
await greenlet_spawn(self.sync_session.close)
async def aclose(self) -> None:
- """Call the close() method of :class:`_asyncio.AsyncSession`"""
+ """This method is a synonym for :func:`.close`
+
+ This method is needed for compatibility with context managers,
+ such as ``@contextlib.aclosing``
+
+ .. versionadded:: 2.0.20
+ """
await self.close()
async def invalidate(self) -> None: