§
    #ˆtj¾
  ã                  óà   — d dl mZ dZd dlZd dlmZ d dlmZmZ d dl	m
Z
 ddlmZ erdd	lmZ ej        d
k    r	d dlmZmZ nd dlmZmZ  ed¦  «        Z ed¦  «        Zddddœdd„Zdd„ZdS ) é    )Úannotations)Úrun_syncÚcurrent_default_thread_limiterN)ÚCallable)ÚTYPE_CHECKINGÚTypeVar)Úwarné   )Úget_async_backend)ÚCapacityLimiter)é   é   )ÚTypeVarTupleÚUnpackÚT_RetvalÚPosArgsTF)Úabandon_on_cancelÚcancellableÚlimiterÚfuncú&Callable[[Unpack[PosArgsT]], T_Retval]ÚargsúUnpack[PosArgsT]r   Úboolr   úbool | Noner   úCapacityLimiter | NoneÚreturnc             ‡  ó’   K  — |�|}t          dt          d¬¦  «         t          ¦   «                              | |||¬¦  «        ƒ d{V —†S )aL  
    Call the given function with the given arguments in a worker thread.

    If the ``abandon_on_cancel`` option is enabled and the task waiting for its
    completion is cancelled, the thread will still run its course but its
    return value (or any raised exception) will be ignored.

    :param func: a callable
    :param args: positional arguments for the callable
    :param abandon_on_cancel: ``True`` to abandon the thread (leaving it to run
        unchecked on own) if the host task is cancelled, ``False`` to ignore
        cancellations in the host task until the operation has completed in the worker
        thread
    :param cancellable: deprecated alias of ``abandon_on_cancel``; will override
        ``abandon_on_cancel`` if both parameters are passed
    :param limiter: capacity limiter to use to limit the total amount of threads running
        (if omitted, the default limiter is used)
    :raises NoEventLoopError: if no supported asynchronous event loop is running in the
        current thread
    :return: an awaitable that yields the return value of the function.

    NzƒThe `cancellable=` keyword argument to `anyio.to_thread.run_sync` is deprecated since AnyIO 4.1.0; use `abandon_on_cancel=` insteadé   )Ú
stacklevel)r   r   )r	   ÚDeprecationWarningr   Úrun_sync_in_worker_thread)r   r   r   r   r   s        úM/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/anyio/to_thread.pyr   r      s„   è è € ð: ÐØ'ÐÝðMåØð		
ñ 	
ô 	
ð 	
õ #Ñ$Ô$×>Ò>ØˆdÐ&7Àð ?ñ ô ð ð ð ð ð ð ð ó    r   c                 óB   — t          ¦   «                              ¦   «         S )a  
    Return the capacity limiter that is used by default to limit the number of
    concurrent threads.

    :return: a capacity limiter object
    :raises NoEventLoopError: if no supported asynchronous event loop is running in the
        current thread

    )r   r   © r$   r#   r   r   F   s   € õ ÑÔ×=Ò=Ñ?Ô?Ð?r$   )r   r   r   r   r   r   r   r   r   r   r   r   )r   r   )Ú
__future__r   Ú__all__ÚsysÚcollections.abcr   Útypingr   r   Úwarningsr	   Ú_core._eventloopr   Ú_core._synchronizationr   Úversion_infor   r   Útyping_extensionsr   r   r   r   r&   r$   r#   ú<module>r1      s>  ðØ "Ð "Ð "Ð "Ð "Ð "ð€ð
 €
€
€
Ø $Ð $Ð $Ð $Ð $Ð $Ø )Ð )Ð )Ð )Ð )Ð )Ð )Ð )Ø Ð Ð Ð Ð Ð à /Ð /Ð /Ð /Ð /Ð /àð 8Ø7Ð7Ð7Ð7Ð7Ð7àÔ�wÒÐØ+Ð+Ð+Ð+Ð+Ð+Ð+Ð+Ð+à6Ð6Ð6Ð6Ð6Ð6Ð6Ð6àˆ7�:ÑÔ€Øˆ<˜
Ñ#Ô#€ð $Ø#Ø&*ð(ð (ð (ð (ð (ð (ðV
@ð 
@ð 
@ð 
@ð 
@ð 
@r$   