Format: application/x-python-code
⬇ Download File (2.5 KB)
   1  o
   2  
   3  ;'h\	�@s�ddlmZddlZddlmZddlmZddlmZddl	m
   4  Z
   5  ddlmZej
   6  d	kr6dd
   7  lmZmZndd
   8  lmZmZed�Zed�Zd
   9  ddd�ddd�Zd dd�ZdS)!�)�annotationsN)�Callable)�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�s6�|dur|}tdtdd�t�j||||d�IdHS)a�
  10      Call the given function with the given arguments in a worker thread.
  11  
  12      If the ``cancellable`` option is enabled and the task waiting for its completion is
  13      cancelled, the thread will still run its course but its return value (or any raised
  14      exception) will be ignored.
  15  
  16      :param func: a callable
  17      :param args: positional arguments for the callable
  18      :param abandon_on_cancel: ``True`` to abandon the thread (leaving it to run
  19          unchecked on own) if the host task is cancelled, ``False`` to ignore
  20          cancellations in the host task until the operation has completed in the worker
  21          thread
  22      :param cancellable: deprecated alias of ``abandon_on_cancel``; will override
  23          ``abandon_on_cancel`` if both parameters are passed
  24      :param limiter: capacity limiter to use to limit the total amount of threads running
  25          (if omitted, the default limiter is used)
  26      :return: an awaitable that yields the return value of the function.
  27  
  28      Nz�The `cancellable=` keyword argument to `anyio.to_thread.run_sync` is deprecated since AnyIO 4.1.0; use `abandon_on_cancel=` instead�)�
  29  stacklevel)rr)r�DeprecationWarningrZrun_sync_in_worker_thread)rrrrr�r�EC:\Users\shubh\Videos\agent\nova\Lib\site-packages\anyio/to_thread.py�run_syncs���rrcCs
  30  t���S)z�
  31      Return the capacity limiter that is used by default to limit the number of
  32      concurrent threads.
  33  
  34      :return: a capacity limiter object
  35  
  36      )r�current_default_thread_limiterrrrrr =s
  37  r )rrrrrrrrrrrr
  38  )rr)�
  39  __future__r�sys�collections.abcr�typingr�warningsrZ_core._eventloopr�abcr�version_inforrZtyping_extensionsr
  40  rrr rrrr�<module>s"
  41  �)