Minor changes
This commit is contained in:
parent
b39d0ff809
commit
1c870da111
|
@ -11,7 +11,9 @@ async def main_cancel(i):
|
||||||
print(f"[main] Child spawned, waiting {i} seconds before canceling it")
|
print(f"[main] Child spawned, waiting {i} seconds before canceling it")
|
||||||
await structio.sleep(i)
|
await structio.sleep(i)
|
||||||
print("[main] Cancelling child")
|
print("[main] Cancelling child")
|
||||||
# Tasks can be cancelled individually, if necessary
|
# Tasks can be cancelled individually, if necessary.
|
||||||
|
# Cancellation is not a checkpoint, by the way (as
|
||||||
|
# evidenced by the lack of the 'await' keyword!)
|
||||||
task.cancel()
|
task.cancel()
|
||||||
print(f"[main] Exited in {structio.clock() - t:.2f} seconds")
|
print(f"[main] Exited in {structio.clock() - t:.2f} seconds")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue