#task #tokio-task #abort #join #cancel #drop

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

#608 in Asynchronous

Download history 8327/week @ 2024-05-17 5735/week @ 2024-05-24 7000/week @ 2024-05-31 6919/week @ 2024-06-07 8045/week @ 2024-06-14 9661/week @ 2024-06-21 9178/week @ 2024-06-28 11879/week @ 2024-07-05 11273/week @ 2024-07-12 14086/week @ 2024-07-19 13587/week @ 2024-07-26 18126/week @ 2024-08-02 12447/week @ 2024-08-09 13102/week @ 2024-08-16 8668/week @ 2024-08-23 6976/week @ 2024-08-30

44,192 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.2–4MB
~63K SLoC