class documentation

class async_scoped_session(ScopedSessionMixin):

View In Hierarchy

Provides scoped management of .AsyncSession objects.

See the section :ref:`asyncio_scoped_session` for usage details.

New in version 1.4.19.
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.
def __init__(self, session_factory, scopefunc):
Construct a new _asyncio.async_scoped_session.
Parameters
session​_factory

a factory to create new _asyncio.AsyncSession instances. This is usually, but not necessarily, an instance of _orm.sessionmaker which itself was passed the _asyncio.AsyncSession to its :paramref:`_orm.sessionmaker.class_` parameter:

async_session_factory = sessionmaker(some_async_engine, class_= AsyncSession)
AsyncSession = async_scoped_session(async_session_factory, scopefunc=current_task)
scopefuncfunction which defines the current scope. A function such as asyncio.current_task may be useful here.
async def remove(self):

Dispose of the current .AsyncSession, if present.

Different from scoped_session's remove method, this method would use await to wait for the close method of AsyncSession.

_support_async: bool =

Undocumented

registry =

Undocumented

session_factory =

Undocumented

@property
_proxied =