
    ,h                    ~   S SK Jr  S SKrS SKrS SKJr  S SKJr  S SKJr  S SKJr  SrSr	 S SK
r
SrS	S
KJr  S	SKJr  S	SKJr  S	SKJr  S	SKJr  S	SKJr  S	SKJr  \" S5      r " S S5      r\R0                  (       d$  \(       d  S rS rS rS rS rS rS rS rS rggg! \ a  r\" \5      r	 SrCN[SrCff = f)    )annotationsN)Any)Callable)	Coroutine)TypeVarFT   )
await_only)await_fallback)in_greenlet)greenlet_spawn)is_exit_exception)AsyncAdaptedLock)_Runner_Tc                  `    \ rS rSrSrS	S jr        S
S jr        SS jrS	S jrSr	g)
_AsyncUtil&   z&Asyncio util for test suite/ util onlyc                :    [         (       a  [        5       U l        g g N)have_greenletr   runnerselfs    S/var/www/auris/envauris/lib/python3.13/site-packages/sqlalchemy/util/concurrency.py__init___AsyncUtil.__init__)   s    =!)DK     c                D    U R                   R                  U" U0 UD65      $ )zRun coroutine on the loop)r   runr   fnargskwargss       r   r   _AsyncUtil.run-   s!     {{r426233r   c                    [         (       a]  U R                  R                  5       R                  5       (       a  U" U0 UD6$ U R                  R	                  [        U/UQ70 UD65      $ U" U0 UD6$ )z3Run sync function in greenlet. Support nested calls)r   r   get_loop
is_runningr   r   r    s       r   run_in_greenlet_AsyncUtil.run_in_greenlet6   sg     ={{##%00224*6**{{~b'J4'J6'JKKt&v&&r   c                P    [         (       a  U R                  R                  5         g g r   )r   r   closer   s    r   r+   _AsyncUtil.closeB   s    =KK r   )r   N)returnNone)r!   z&Callable[..., Coroutine[Any, Any, _T]]r"   r   r#   r   r-   r   )r!   zCallable[..., _T]r"   r   r#   r   r-   r   )
__name__
__module____qualname____firstlineno____doc__r   r   r(   r+   __static_attributes__ r   r   r   r   &   s_    0$424 4 	4
 
4
'#
',/
';>
'	
' r   r   c                 `    [         (       a  g [        [        (       a  S[        -  5      eS5      e)Nz9the greenlet library is required to use this function. %s )r   
ValueErrorgreenlet_errorr5   r   r   _not_implementedr:   I   s<     = ~"#
 	
 	
 	
r   c                ,    [        U [        5      (       + $ r   )
isinstance	Exception)es    r   r   r   V   s    a+++r   c                    [        5         g r   r:   things    r   r	   r	   Y       r   c                    U $ r   r5   rA   s    r   r
   r
   \   s    r   c                     [        5         g r   r@   r5   r   r   r   r   _   rC   r   c                    [        5         g r   r@   )r!   r"   kws      r   r   r   b   rC   r   c                     [        5         g r   r@   )r"   rG   s     r   r   r   e   rC   r   c                    U " U0 UD6$ r   r5   r!   argrG   s      r   _util_async_runrL   h   s    3~"~r   c                    [        5         g r   r@   rJ   s      r   "_util_async_run_coroutine_functionrN   k   rC   r   )
__future__r   asynciotypingr   r   r   r   r   r9   greenlet_concurrency_py3kr	   r
   r   r   r   r   r   ImportErrorr>   strr   r   TYPE_CHECKINGr:   rL   rN   r5   r   r   <module>rW      s    #      +
 M;C=CIG*T]   B M
,I %2c  	VN	s   B$ $B<*B77B<