[issue44306] asyncio.from_thread

2022-03-23 Thread Andrew Svetlov
Andrew Svetlov added the comment: How is it better than passing the loop instance explicitly? What is the real use case? -- ___ Python tracker ___

[issue44306] asyncio.from_thread

2021-06-03 Thread Thomas Grainger
Thomas Grainger added the comment: """High-level support for working with threads in asyncio""" import functools import contextvars from . import events from . import tasks __all__ = "to_thread", "from_thread" class _Local(threading.local): loop = None _local = _Local() def _with_

[issue44306] asyncio.from_thread

2021-06-03 Thread Thomas Grainger
New submission from Thomas Grainger : create a asyncio.from_thread shortcut to run async functions from a thread started with asyncio.to_thread ``` def from_thread(async_func, /, *args, **kwargs): """Synchronously run function *async_func* in the event loop thread. Any *args and **kw