Replies: 2 comments 6 replies
-
Cancellation works by running the destructor of the future. This causes the future to stop running next time it yields at an However, be aware that using let task = tokio::spawn(...);
timeout(&mut task, duration).await;
task.abort(); // <-- this causes cancellation |
Beta Was this translation helpful? Give feedback.
-
Hello All,
If I understand correctly, launch_task() never returns until the timeout is reached and the task is aborted. isn't ?? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
If i create a handle by tokio::spawn, how does tokio timeout works to cancel that handle?
Like if I see tokio task as a thread, will tokio send a sigkill to stop that thread?
Beta Was this translation helpful? Give feedback.
All reactions