#task #abort #join #drop #cancel

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

#651 in Asynchronous

Download history 2271/week @ 2023-11-24 2800/week @ 2023-12-01 3159/week @ 2023-12-08 3186/week @ 2023-12-15 1465/week @ 2023-12-22 2279/week @ 2023-12-29 4370/week @ 2024-01-05 3625/week @ 2024-01-12 2689/week @ 2024-01-19 2364/week @ 2024-01-26 2340/week @ 2024-02-02 3609/week @ 2024-02-09 5359/week @ 2024-02-16 6094/week @ 2024-02-23 6832/week @ 2024-03-01 2925/week @ 2024-03-08

22,288 downloads per month
Used in 2 crates (via roslibrust)

BSD-2-Clause

6KB
116 lines

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.


lib.rs:

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.3–4MB
~66K SLoC