🐐 GOAT Shell
Current path:
opt
/
alt
/
python310
/
lib64
/
python3.10
/
asyncio
/
👤 Create WP Admin
⬆️
Go up: python3.10
✏️ Editing: threads.py
"""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)
Save
📁
__pycache__
|
✏️ Rename
|
🗑️ Delete
📄
base_events.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
base_futures.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
base_subprocess.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
base_tasks.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
constants.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
coroutines.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
events.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
exceptions.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
format_helpers.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
futures.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
locks.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
log.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
mixins.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
proactor_events.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
protocols.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
queues.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
runners.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
selector_events.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
sslproto.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
staggered.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
streams.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
subprocess.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
tasks.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
threads.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
transports.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
trsock.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
unix_events.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
windows_events.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
windows_utils.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
__init__.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📄
__main__.py
|
✏️ Edit
|
✏️ Rename
|
🗑️ Delete
📤 Upload File
Upload
📁 Create Folder
Create Folder