a cL@sddlmZmZmZddlmZddlmZddlm Z edZ ddd ed e fe e ee e d d d Z ddd ed e fe e ee e d ddZe dddZe dddZdS))CallableOptionalTypeVar)warn) get_asynclib)CapacityLimiterT_RetvalFN cancellablelimiter.)funcargsr r returncs"tj|g|R||dIdHS)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)rrun_sync_in_worker_threadr r r rr\/workspaces/shunt/resources/test-fastapi/venv/lib/python3.9/site-packages/anyio/to_thread.pyrun_sync srcs(tdtt|g|R||dIdHS)NzWrun_sync_in_worker_thread() has been deprecated, use anyio.to_thread.run_sync() insteadr )rDeprecationWarningrrrrrr$s r)rcCs tS)z Return the capacity limiter that is used by default to limit the number of concurrent threads. :return: a capacity limiter object )rcurrent_default_thread_limiterrrrrr1srcCstdttS)Nzycurrent_default_worker_thread_limiter() has been deprecated, use anyio.to_thread.current_default_thread_limiter() instead)rrrrrrr%current_default_worker_thread_limiter;s r)typingrrrwarningsrZ_core._eventlooprabcrr objectboolrrrrrrrrs0