Replies: 1 comment 5 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.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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