We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a7d2512 commit de48a23Copy full SHA for de48a23
core/examples/basic.rs
@@ -14,14 +14,16 @@ use tokio_core::reactor::Core;
14
15
fn main() {
16
let mut core = Core::new().unwrap();
17
+ let handle = core.handle();
18
19
let host = Local::new().and_then(|host| {
20
Command::new(&host, "whoami", None).and_then(|mut cmd| {
- cmd.exec().map(|out| {
21
+ cmd.exec(&handle).map(|out| {
22
println!("I'm currently running as {}", String::from_utf8_lossy(&out.stdout).trim());
23
})
24
25
});
26
27
core.run(host).unwrap();
28
}
29
+
0 commit comments