o
    =a                     @   sd   d dl mZ ddlmZ ddlmZ ddlmZ eeddg dg d	g d
dG dd deZdS )   )AsyncSession   )ScopedSessionMixin)create_proxy_methods)ScopedRegistryz:class:`_asyncio.AsyncSession`z.:class:`_asyncio.scoping.async_scoped_session`)	close_allobject_sessionidentity_key)__contains____iter__addadd_allbeginbegin_nestedclosecommit
connectiondeleteexecuteexpire
expire_allexpungeexpunge_allflushgetget_bindis_modifiedmergerefreshrollbackscalar)	binddirtydeletednewidentity_map	is_active	autoflushno_autoflushinfo)classmethodsmethods
attributesc                   @   s,   e Zd ZdZdd Zedd Zdd ZdS )	async_scoped_sessionzProvides scoped management of :class:`.AsyncSession` objects.

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

    .. versionadded:: 1.4.19


    c                 C   s   || _ t||| _dS )a  Construct a new :class:`_asyncio.async_scoped_session`.

        :param session_factory: a factory to create new :class:`_asyncio.AsyncSession`
         instances. This is usually, but not necessarily, an instance
         of :class:`_orm.sessionmaker` which itself was passed the
         :class:`_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)

        :param scopefunc: function which defines
         the current scope.   A function such as ``asyncio.current_task``
         may be useful here.

        N)session_factoryr   registry)selfr.   	scopefunc r2   T/var/www/html/gps/gps/lib/python3.10/site-packages/sqlalchemy/ext/asyncio/scoping.py__init__B   s   zasync_scoped_session.__init__c                 C   s   |   S )N)r/   r0   r2   r2   r3   _proxiedW   s   zasync_scoped_session._proxiedc                    s,   | j  r|    I dH  | j   dS )zDispose of the current :class:`.AsyncSession`, if present.

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

        N)r/   hasr   clearr5   r2   r2   r3   remove[   s   
zasync_scoped_session.removeN)__name__
__module____qualname____doc__r4   propertyr6   r9   r2   r2   r2   r3   r-      s    +	
r-   N)sessionr   orm.scopingr   utilr   r   r-   r2   r2   r2   r3   <module>   s   *