await self.registry().close()
self.registry.clear()
+ @classmethod
+ async def close_all(cls) -> None:
+ r"""Close all :class:`_asyncio.AsyncSession` sessions.
+
+ .. container:: class_bases
+
+ Proxied for the :class:`_asyncio.AsyncSession` class on
+ behalf of the :class:`_asyncio.scoping.async_scoped_session` class.
+
+ .. deprecated:: 2.0 The :meth:`.AsyncSession.close_all` method is deprecated and will be removed in a future release. Please refer to :func:`.session.close_all_sessions`.
+
+ """ # noqa: E501
+
+ return await AsyncSession.close_all()
+
# START PROXY METHODS async_scoped_session
# code within this block is **programmatically,
return self._proxied.info
- @classmethod
- async def close_all(cls) -> None:
- r"""Close all :class:`_asyncio.AsyncSession` sessions.
-
- .. container:: class_bases
-
- Proxied for the :class:`_asyncio.AsyncSession` class on
- behalf of the :class:`_asyncio.scoping.async_scoped_session` class.
-
- .. deprecated:: 2.0 The :meth:`.AsyncSession.close_all` method is deprecated and will be removed in a future release. Please refer to :func:`.session.close_all_sessions`.
-
- """ # noqa: E501
-
- return await AsyncSession.close_all()
-
@classmethod
def object_session(cls, instance: object) -> Optional[Session]:
r"""Return the :class:`.Session` to which an object belongs.