Files
aitsc/.venv/Lib/site-packages/anyio/__pycache__/to_thread.cpython-312.pyc

38 lines
2.8 KiB
Plaintext
Raw Normal View History

2025-02-23 09:07:52 +08:00
<EFBFBD>
q&<26>h<EFBFBD> <00><01><><00>ddlmZddlZddlmZddlmZddlmZddl m
2025-02-23 09:07:52 +08:00
Z
ddl m Z ejd k\r dd
lmZmZndd
lmZmZed <0B>Zed <0C>Zd ddd<0E> dd<0F>Zdd<10>Zy)<13>)<01> annotationsN)<01>Callable)<01>TypeVar)<01>warn<72>)<01>get_async_backend)<01>CapacityLimiter)<02><00> )<02> TypeVarTuple<6C>Unpack<63>T_Retval<61>PosArgsTF)<03>abandon_on_cancel<65> cancellable<6C>limiterc<00><01><>K<00>|<02>|}tdtd<03><04>t<00>j||||<03><05><00>d{<00><02><03>S7<00><04>w)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 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)
:return: an awaitable that yields the return value of the function.
Nz<4E>The `cancellable=` keyword argument to `anyio.to_thread.run_sync` is deprecated since AnyIO 4.1.0; use `abandon_on_cancel=` instead<61>)<01>
stacklevel)rr)r<00>DeprecationWarningr<00>run_sync_in_worker_thread)<05>funcrrr<00>argss <20>8D:\xxxx\aitsc\.venv\Lib\site-packages\anyio\to_thread.py<70>run_syncrsY<00><00><><00>6<13><1E>'<27><19> <0C> M<01> <1E><18> 
2025-02-23 09:07:52 +08:00
<EFBFBD>#<23>$<24>><3E>><3E> <0C>d<EFBFBD>&7<><17>?<3F><06> <06><06> <06>s<00>7A<01>><04>Ac<01>2<00>t<00>j<00>S)z<>
Return the capacity limiter that is used by default to limit the number of
concurrent threads.
:return: a capacity limiter object
)r<00>current_default_thread_limiter<65><00>rrr=s<00><00> <1D> <1E> =<3D> =<3D> ?<3F>?r) rz&Callable[[Unpack[PosArgsT]], T_Retval]rzUnpack[PosArgsT]r<00>boolrz bool | NonerzCapacityLimiter | None<6E>returnr)r!r )<15>
__future__r<00>sys<79>collections.abcr<00>typingr<00>warningsr<00>_core._eventloopr<00>abcr <00> version_infor r <00>typing_extensionsrrrrrrr<00><module>r+s<><00><01>"<22>
<EFBFBD>$<24><1A><19>/<2F> <20><06><13><13>w<EFBFBD><1E>+<2B>+<2B>6<> <12>:<3A> <1E><08> <17>
<EFBFBD> #<23><08> $<24>#<23>&*<2A> &<06>
0<EFBFBD>&<06> <1B>&<06><1C>&<06><1D> &<06>
$<24> &<06> <0E> &<06>R@r