/opt/imh-python/lib/python3.9/asyncio
NameSizeModeActions
__pycache__/-0755rm
base_events.py738090644editdlrm
base_futures.py25740644editdlrm
base_subprocess.py88430644editdlrm
base_tasks.py24670644editdlrm
constants.py8880644editdlrm
coroutines.py87970644editdlrm
events.py263780644editdlrm
exceptions.py16330644editdlrm
format_helpers.py24040644editdlrm
futures.py140180644editdlrm
locks.py149490644editdlrm
log.py1240644editdlrm
proactor_events.py320530644editdlrm
protocols.py71360644editdlrm
queues.py82810644editdlrm
runners.py21240644editdlrm
selector_events.py395020644editdlrm
sslproto.py271840644editdlrm
staggered.py59920644editdlrm
streams.py266560644editdlrm
subprocess.py80680644editdlrm
tasks.py342860644editdlrm
threads.py7900644editdlrm
transports.py104860644editdlrm
trsock.py58760644editdlrm
unix_events.py517640644editdlrm
windows_events.py329070644editdlrm
windows_utils.py50600644editdlrm
__init__.py12790644editdlrm
__main__.py33430644editdlrm
Edit: /opt/imh-python/lib/python3.9/asyncio/threads.py (790B)
"""High-level support for working with threads in asyncio""" import functools import contextvars from . import events __all__ = "to_thread", async def to_thread(func, /, *args, **kwargs): """Asynchronously run function *func* in a separate thread. Any *args and **kwargs supplied for this function are directly passed to *func*. Also, the current :class:`contextvars.Context` is propagated, allowing context variables from the main thread to be accessed in the separate thread. Return a coroutine that can be awaited to get the eventual result of *func*. """ loop = events.get_running_loop() ctx = contextvars.copy_context() func_call = functools.partial(ctx.run, func, *args, **kwargs) return await loop.run_in_executor(None, func_call)