This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author graingert
Recipients asvetlov, graingert, yselivanov
Date 2021-06-03.22:08:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1622758125.93.0.576935961865.issue44306@roundup.psfhosted.org>
In-reply-to
Content
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.
```
History
Date User Action Args
2021-06-03 22:08:45graingertsetrecipients: + graingert, asvetlov, yselivanov
2021-06-03 22:08:45graingertsetmessageid: <1622758125.93.0.576935961865.issue44306@roundup.psfhosted.org>
2021-06-03 22:08:45graingertlinkissue44306 messages
2021-06-03 22:08:45graingertcreate