diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2020-01-22 02:01:10 +0900 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2020-01-21 12:01:10 -0500 |
commit | 9de8178c9b9bc21cc880ea81f163118408cc6c46 (patch) | |
tree | ec0e7f46868959bf5132d562f9a2258d2437176a /cli/state.rs | |
parent | ecd1d3abb0cae9c7cbc1330cbaa035a5786e94d7 (diff) |
feat: add AsyncUnref ops (#3721)
This is in order to support features like signal handlers, which
shouldn't prevent the program from exiting.
Diffstat (limited to 'cli/state.rs')
-rw-r--r-- | cli/state.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cli/state.rs b/cli/state.rs index 02c258280..c07b3d5d0 100644 --- a/cli/state.rs +++ b/cli/state.rs @@ -110,6 +110,14 @@ impl ThreadSafeState { }); Op::Async(result_fut.boxed()) } + Op::AsyncUnref(fut) => { + let state = state.clone(); + let result_fut = fut.map_ok(move |buf: Buf| { + state.metrics_op_completed(buf.len()); + buf + }); + Op::AsyncUnref(result_fut.boxed()) + } } } } |