diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2019-12-30 14:57:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-30 14:57:17 +0100 |
commit | 46d76a7562025374600a7f866dfc68c1b7e268e9 (patch) | |
tree | 0681d383781d8a28ac7ea23d75f22b1faeea0208 /cli/ops/workers.rs | |
parent | df1665a8fc92168c3eb115a768ecfeccbe575e18 (diff) |
upgrade: Tokio 0.2 (#3418)
Diffstat (limited to 'cli/ops/workers.rs')
-rw-r--r-- | cli/ops/workers.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/cli/ops/workers.rs b/cli/ops/workers.rs index 467d0bfb2..131283614 100644 --- a/cli/ops/workers.rs +++ b/cli/ops/workers.rs @@ -168,14 +168,13 @@ fn op_create_worker( // TODO(bartlomieju): this should spawn mod execution on separate tokio task // and block on receving message on a channel or even use sync channel /shrug let (sender, receiver) = mpsc::sync_channel::<Result<(), ErrBox>>(1); - let fut = worker - .execute_mod_async(&module_specifier, None, false) - .then(move |result| { - sender.send(result).expect("Failed to send message"); - futures::future::ok(()) - }) - .boxed() - .compat(); + let fut = async move { + let result = worker + .execute_mod_async(&module_specifier, None, false) + .await; + sender.send(result).expect("Failed to send message"); + } + .boxed(); tokio::spawn(fut); let result = receiver.recv().expect("Failed to receive message"); |