#task #cancel #abort #drop #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

#859 in Asynchronous

Download history 2575/week @ 2023-08-19 2924/week @ 2023-08-26 2110/week @ 2023-09-02 3344/week @ 2023-09-09 3128/week @ 2023-09-16 2346/week @ 2023-09-23 3150/week @ 2023-09-30 3665/week @ 2023-10-07 3596/week @ 2023-10-14 2738/week @ 2023-10-21 2342/week @ 2023-10-28 2041/week @ 2023-11-04 2491/week @ 2023-11-11 1907/week @ 2023-11-18 2702/week @ 2023-11-25 2364/week @ 2023-12-02

9,785 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–3.5MB
~64K SLoC