summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/threads.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix asyncio.to_thread() documented return type (GH-20547)Kyle Stanley2020-05-311-1/+1
| | | | | When I wrote the documentation for `asyncio.to_thread()`, I mistakenly assumed that `return await loop.run_in_executor(...)` within an async def function would return a Future. In reality, it returns a coroutine. This likely won't affect typical usage of `asyncio.to_thread()`, but it's important for the documentation to be correct here. In general, we also tend to avoid returning futures from high-level APIs in asyncio.
* bpo-32309: Add support for contextvars in asyncio.to_thread() (GH-20278)Kyle Stanley2020-05-211-2/+6
| | | | | Allows contextvars from the main thread to be accessed in the separate thread used in `asyncio.to_thread()`. See the [discussion](https://github.com/python/cpython/pull/20143#discussion_r427808225) in GH-20143 for context. Automerge-Triggered-By: @aeros
* bpo-32309: Implement asyncio.to_thread() (GH-20143)Kyle Stanley2020-05-191-0/+21
Implements `asyncio.to_thread`, a coroutine for asynchronously running IO-bound functions in a separate thread without blocking the event loop. See the discussion starting from [here](https://github.com/python/cpython/pull/18410#issuecomment-628930973) in GH-18410 for context. Automerge-Triggered-By: @aeros