diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-01-04 03:51:32 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-01-04 03:51:32 -0600 |
| commit | 1c02eebc71a0ede4e75fea516920697850bbe030 (patch) | |
| tree | 3a54355a5e34d5539fe413e0e3b17a8e9b832601 /examples | |
| parent | b5c8846482d5309fac92c7ab94d4f53690b201b4 (diff) | |
Implement unmount
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/passthrough.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/examples/passthrough.rs b/examples/passthrough.rs index c25d728..5ecb2e8 100644 --- a/examples/passthrough.rs +++ b/examples/passthrough.rs @@ -389,5 +389,12 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { } }; - Ok(Runtime::new()?.block_on(main_loop(session, fs))?) + let result = Runtime::new()?.block_on(async move { + tokio::select! { + result = main_loop(session, fs) => result, + _ = tokio::signal::ctrl_c() => Ok(()), + } + }); + + Ok(result?) } |
