Message395054
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.
``` |
|
Date |
User |
Action |
Args |
2021-06-03 22:08:45 | graingert | set | recipients:
+ graingert, asvetlov, yselivanov |
2021-06-03 22:08:45 | graingert | set | messageid: <1622758125.93.0.576935961865.issue44306@roundup.psfhosted.org> |
2021-06-03 22:08:45 | graingert | link | issue44306 messages |
2021-06-03 22:08:45 | graingert | create | |
|