
    Lc[                         d dl mZmZmZ d dlmZ ddlmZ ddlm	Z	  ed          Z
ddd	d
ede
f         dededee	         de
f
dZddd	d
ede
f         dededee	         de
f
dZde	fdZde	fdZdS )    )CallableOptionalTypeVar)warn   )get_asynclib)CapacityLimiterT_RetvalFNcancellablelimiterfunc.argsr   r   returnc                N   K    t                      j        | g|R ||d d{V S )a  
    Call the given function with the given arguments in a worker thread.

    If the ``cancellable`` 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 cancellable: ``True`` to allow cancellation of the operation
    :param limiter: capacity limiter to use to limit the total amount of threads running
        (if omitted, the default limiter is used)
    :return: an awaitable that yields the return value of the function.

    r   N)r   run_sync_in_worker_threadr   r   r   r   s       /lib/python3.11/site-packages/anyio/to_thread.pyrun_syncr   
   sl      $ :9$ K K KS^BIK K K K K K K K K K    c                ^   K   t          dt                     t          | g|R ||d d {V S )NzWrun_sync_in_worker_thread() has been deprecated, use anyio.to_thread.run_sync() insteadr   )r   DeprecationWarningr   r   s       r   r   r       sR       		b	  $PPP;PPPPPPPPPPr   c                  B    t                                                      S )z
    Return the capacity limiter that is used by default to limit the number of concurrent threads.

    :return: a capacity limiter object

    )r   current_default_thread_limiter r   r   r   r   (   s     >>88:::r   c                  H    t          dt                     t                      S )Nzycurrent_default_worker_thread_limiter() has been deprecated, use anyio.to_thread.current_default_thread_limiter() instead)r   r   r   r   r   r   %current_default_worker_thread_limiterr   2   s+     
H	   *+++r   )typingr   r   r   warningsr   _core._eventloopr   abcr	   r
   objectboolr   r   r   r   r   r   r   <module>r$      sz   . . . . . . . . . .       * * * * * *            7: KP-1K K KsH}%K.4KCGK/*K6>K K K K. KP-1Q Q QsH}%Q.4QCGQ/*Q6>Q Q Q Q; ; ; ; ;, , , , , , ,r   