diff options
author | 2021-01-06 18:03:18 -0800 | |
---|---|---|
committer | 2021-01-07 12:03:18 +1000 | |
commit | 5c30145afb6053998e3518befff638d207047f00 (patch) | |
tree | 1cf588f77b68fefe2dacaa0eaa183bd3e6feb43e /Doc | |
parent | bpo-42847: Normalise Lib/sqlite3/test/* file encodings (GH-24147) (diff) | |
download | cpython-5c30145afb6053998e3518befff638d207047f00.tar.gz cpython-5c30145afb6053998e3518befff638d207047f00.tar.bz2 cpython-5c30145afb6053998e3518befff638d207047f00.zip |
bpo-42783: Documentation for asyncio.sleep(0) (#24002)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/asyncio-task.rst | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index 45e58437e03..1ca1b4a06d7 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -293,6 +293,10 @@ Sleeping ``sleep()`` always suspends the current task, allowing other tasks to run. + Setting the delay to 0 provides an optimized path to allow other + tasks to run. This can be used by long-running functions to avoid + blocking the event loop for the full duration of the function call. + .. _asyncio_example_sleep: Example of coroutine displaying the current date every second |