/opt/alt/python311/lib64/python3.11/asyncio
NameSizeModeActions
__pycache__/-0755rm
base_events.py753840644editdlrm
base_futures.py20040644editdlrm
base_subprocess.py88690644editdlrm
base_tasks.py26440644editdlrm
constants.py13260644editdlrm
coroutines.py34000644editdlrm
events.py286410644editdlrm
exceptions.py17520644editdlrm
format_helpers.py24040644editdlrm
futures.py142120644editdlrm
locks.py190140644editdlrm
log.py1240644editdlrm
mixins.py4810644editdlrm
proactor_events.py332640644editdlrm
protocols.py69570644editdlrm
queues.py79740644editdlrm
runners.py68420644editdlrm
selector_events.py454000644editdlrm
sslproto.py317390644editdlrm
staggered.py59920644editdlrm
streams.py275030644editdlrm
subprocess.py76820644editdlrm
taskgroups.py84710644editdlrm
tasks.py344330644editdlrm
threads.py7900644editdlrm
timeouts.py53210644editdlrm
transports.py107220644editdlrm
trsock.py24750644editdlrm
unix_events.py519150644editdlrm
windows_events.py346910644editdlrm
windows_utils.py50600644editdlrm
__init__.py11880644editdlrm
__main__.py33790644editdlrm
Edit: /opt/alt/python311/lib64/python3.11/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)