a
    ^ŠÝgÒ  ã                   @  sÂ   d dl mZ d dlZd dlZd dlZd dlZd dlZejdkrLd dlm	Z	 nd dl
m	Z	 e	dƒZe d¡Zddd	œd
d„Zdddddœdd„ZG dd„ deƒZdddœdd„Zdddœdd„ZdS )é    )ÚannotationsN)é   é
   )Ú	ParamSpecÚPÚTztuple[typing.Callable, dict]ÚNone)ÚargsÚreturnc               	   ‡  sˆ   t  dt¡ t ¡ 4 I d H šR‰ dddœ‡ fdd„}| D ]"\}}ˆ  |tj|fi |¤Ž¡ q6W d   ƒI d H  q„1 I d H sz0    Y  d S )NzOrun_until_first_complete is deprecated and will be removed in a future version.z%typing.Callable[[], typing.Coroutine]r   )Úfuncr
   c                 “  s   | ƒ I d H  ˆ j  ¡  d S ©N)Zcancel_scopeÚcancel)r   ©Z
task_group© úc/var/www/html/cobodadashboardai.evdpl.com/venv/lib/python3.9/site-packages/starlette/concurrency.pyÚrun   s    z%run_until_first_complete.<locals>.run)ÚwarningsÚwarnÚDeprecationWarningÚanyioZcreate_task_groupZ
start_soonÚ	functoolsÚpartial)r	   r   r   Úkwargsr   r   r   Úrun_until_first_complete   s    þr   ztyping.Callable[P, T]zP.argszP.kwargs)r   r	   r   r
   c                 Ï  s*   t j| g|¢R i |¤Ž} tj | ¡I d H S r   )r   r   r   Ú	to_threadÚrun_sync)r   r	   r   r   r   r   Úrun_in_threadpool#   s    r   c                   @  s   e Zd ZdS )Ú_StopIterationN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   (   s   r   ztyping.Iterator[T])Úiteratorr
   c                 C  s&   z
t | ƒW S  ty    t‚Y n0 d S r   )ÚnextÚStopIterationr   )r!   r   r   r   Ú_next,   s    
r$   ztyping.Iterable[T]ztyping.AsyncIterator[T]c                 C s@   t | ƒ}ztj t|¡I d H V  W q ty8   Y q<Y q0 qd S r   )Úiterr   r   r   r$   r   )r!   Zas_iteratorr   r   r   Úiterate_in_threadpool6   s
    r&   )Ú
__future__r   r   ÚsysÚtypingr   Zanyio.to_threadr   Úversion_infor   Ztyping_extensionsr   ÚTypeVarr   r   r   Ú	Exceptionr   r$   r&   r   r   r   r   Ú<module>   s   


