#task #abort #cancel #join

abort-on-drop

A wrapper of Tokio's JoinHandle that aborts the task when it's dropped, while still allowing it to be awaited for joining

4 releases

0.2.2 Aug 4, 2022
0.2.1 Apr 27, 2022
0.2.0 Apr 27, 2022
0.1.0 Apr 27, 2022

#1543 in Asynchronous

Download history 2982/week @ 2025-10-17 3740/week @ 2025-10-24 2848/week @ 2025-10-31 3243/week @ 2025-11-07 3517/week @ 2025-11-14 2622/week @ 2025-11-21 2889/week @ 2025-11-28 3305/week @ 2025-12-05 4300/week @ 2025-12-12 2159/week @ 2025-12-19 1779/week @ 2025-12-26 5104/week @ 2026-01-02 3502/week @ 2026-01-09 3523/week @ 2026-01-16 3335/week @ 2026-01-23 3035/week @ 2026-01-30

14,910 downloads per month
Used in 5 crates (2 directly)

BSD-2-Clause

6KB
116 lines

This crate provides a wrapper type of Tokio's JoinHandle: ChildTask, which aborts the task when it's dropped. ChildTask can still be awaited to join the child-task, and abort-on-drop will still trigger while it is being awaited.

For example, if task A spawned task B but is doing something else, and task B is waiting for task C to join, aborting A will also abort both B and C.


abort-on-drop

This crate provides a wrapper type of Tokio's JoinHandle: ChildTask, which aborts the task when it's dropped. ChildTask can still be awaited to join the child-task, and abort-on-drop will still trigger while it is being awaited.

For example, if task A spawned task B but is doing something else, and task B is waiting for task C to join, aborting A will also abort both B and C.

Dependencies

~2–3MB
~48K SLoC