#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

#727 in Asynchronous

Download history 4255/week @ 2024-01-10 2988/week @ 2024-01-17 2410/week @ 2024-01-24 2023/week @ 2024-01-31 3227/week @ 2024-02-07 4812/week @ 2024-02-14 6113/week @ 2024-02-21 6204/week @ 2024-02-28 7285/week @ 2024-03-06 5959/week @ 2024-03-13 5607/week @ 2024-03-20 4951/week @ 2024-03-27 5704/week @ 2024-04-03 6734/week @ 2024-04-10 7772/week @ 2024-04-17 6319/week @ 2024-04-24

27,837 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
~65K SLoC