class async_scoped_session(ScopedSessionMixin):
Provides scoped management of .AsyncSession
objects.
See the section :ref:`asyncio_scoped_session` for usage details.
Method | __init__ |
Construct a new _asyncio.async_scoped_session . |
Async Method | remove |
Dispose of the current .AsyncSession , if present. |
Class Variable | _support_async |
Undocumented |
Instance Variable | registry |
Undocumented |
Instance Variable | session_factory |
Undocumented |
Property | _proxied |
Undocumented |
Inherited from ScopedSessionMixin
:
Method | __call__ |
Return the current .Session , creating it using the .scoped_session.session_factory if not present. |
Method | configure |
reconfigure the .sessionmaker used by this .scoped_session . |
_asyncio.async_scoped_session
.Parameters | |
session_factory | a factory to create new async_session_factory = sessionmaker(some_async_engine, class_= AsyncSession) AsyncSession = async_scoped_session(async_session_factory, scopefunc=current_task) |
scopefunc | function which defines the current scope. A function such as asyncio.current_task may be useful here. |