Skip to content

Commit ae6f3be

Browse files
committed
examples: add tokio
1 parent 4257ff8 commit ae6f3be

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"env": {}
77
}
88
],
9-
"rust-analyzer.cargo.features": ["blocking", "tokio"],
9+
"rust-analyzer.cargo.features": "all",
1010
"[rust]": {
1111
"editor.defaultFormatter": "rust-lang.rust-analyzer",
1212
"editor.formatOnSave": true

crates/examples/readme/Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ version = "0.0.0"
44
edition.workspace = true
55

66
[dependencies]
7-
kill_tree = { path = "../../libs/kill_tree" }
7+
kill_tree = { path = "../../libs/kill_tree", features = ["tokio"] }
8+
tokio = { version = "1.36.0", features = ["full"] }
89

910
[[bin]]
1011
name = "kill_tree"
@@ -13,3 +14,7 @@ path = "src/kill_tree.rs"
1314
[[bin]]
1415
name = "kill_tree_sigkill"
1516
path = "src/kill_tree_sigkill.rs"
17+
18+
[[bin]]
19+
name = "kill_tree_tokio"
20+
path = "src/kill_tree_tokio.rs"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
use kill_tree::{get_available_max_process_id, tokio::kill_tree, Result};
2+
3+
#[tokio::main]
4+
async fn main() -> Result<()> {
5+
let _ = kill_tree(get_available_max_process_id()).await?;
6+
Ok(())
7+
}

0 commit comments

Comments
 (0)