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

#979 in Asynchronous

Download history 13205/week @ 2024-07-25 18129/week @ 2024-08-01 14650/week @ 2024-08-08 11374/week @ 2024-08-15 10025/week @ 2024-08-22 8128/week @ 2024-08-29 8093/week @ 2024-09-05 7313/week @ 2024-09-12 6405/week @ 2024-09-19 4071/week @ 2024-09-26 3459/week @ 2024-10-03 4263/week @ 2024-10-10 5609/week @ 2024-10-17 6039/week @ 2024-10-24 4605/week @ 2024-10-31 3754/week @ 2024-11-07

21,220 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–8MB
~64K SLoC