We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2eda004 commit 3db73acCopy full SHA for 3db73ac
docs/threads.rst
@@ -214,13 +214,15 @@ mechanism that allows user code to voluntarily check if the host task's scope ha
214
and if it has, raise a cancellation exception. This can be done by simply calling
215
:func:`from_thread.check_cancelled`::
216
217
- from anyio import to_thread, from_thread
+ import time
218
+
219
+ from anyio import to_thread, from_thread, move_on_after
220
221
def sync_function():
222
while True:
223
from_thread.check_cancelled()
224
print("Not cancelled yet")
- sleep(1)
225
+ time.sleep(1)
226
227
async def foo():
228
with move_on_after(3):
0 commit comments