New submission from Thomas Grainger <tagr...@gmail.com>:
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 **kwargs supplied for this function are directly passed to *func*. Also, the current :class:`contextvars.Context` is propogated, allowing context variables from the main thread to be accessed in the separate thread. Return a concurrent.futures.Future to wait for the result from the event loop thread. ``` ---------- components: asyncio messages: 395054 nosy: asvetlov, graingert, yselivanov priority: normal severity: normal status: open title: asyncio.from_thread _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44306> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com