1#![warn(rustdoc::broken_intra_doc_links, rust_2018_idioms, clippy::all, missing_docs)]
4
5use core::time::Duration;
6
7use lunatic::{ap::ProcessRef, AbstractProcess};
8
9pub use lunatic;
10pub use rand;
11pub use serde;
12
13pub struct Job<T>
17where
18 T: AbstractProcess,
19{
20 pub process: ProcessRef<T>,
22}
23
24impl<T> Drop for Job<T>
25where
26 T: AbstractProcess,
27{
28 fn drop(&mut self) {
29 loop {
30 if let Ok(r) = self.process.with_timeout(Duration::from_millis(100)).shutdown() {
31 break r;
32 }
33 }
34 }
35}