diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2019-11-20 01:17:05 +0100 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2019-11-19 19:17:05 -0500 |
commit | 1912ed674097588adb7b83e7b78043b2168821f3 (patch) | |
tree | f906b35ca15f031e332b6f496e50db6b59491e8f /cli/compilers | |
parent | 6708fcc38688b80d4e052f755f02efb09a2071d1 (diff) |
remove tokio_util::block_on from ops/workers.rs (#3381)
Diffstat (limited to 'cli/compilers')
-rw-r--r-- | cli/compilers/ts.rs | 4 | ||||
-rw-r--r-- | cli/compilers/wasm.rs | 13 |
2 files changed, 9 insertions, 8 deletions
diff --git a/cli/compilers/ts.rs b/cli/compilers/ts.rs index 13823b24f..34bf74ab1 100644 --- a/cli/compilers/ts.rs +++ b/cli/compilers/ts.rs @@ -272,8 +272,8 @@ impl TsCompiler { let worker = TsCompiler::setup_worker(global_state.clone()); let worker_ = worker.clone(); - worker.post_message(req_msg).unwrap(); let first_msg_fut = async move { + worker.post_message(req_msg).await.unwrap(); let result = worker.await; if let Err(err) = result { // TODO(ry) Need to forward the error instead of exiting. @@ -382,8 +382,8 @@ impl TsCompiler { .add("Compile", &module_url.to_string()); let global_state_ = global_state.clone(); - worker.post_message(req_msg).unwrap(); let first_msg_fut = async move { + worker.post_message(req_msg).await.unwrap(); let result = worker.await; if let Err(err) = result { // TODO(ry) Need to forward the error instead of exiting. diff --git a/cli/compilers/wasm.rs b/cli/compilers/wasm.rs index 882e28e43..2e565dd93 100644 --- a/cli/compilers/wasm.rs +++ b/cli/compilers/wasm.rs @@ -86,13 +86,14 @@ impl WasmCompiler { let worker_ = worker.clone(); let url = source_file.url.clone(); - let _res = worker.post_message( - serde_json::to_string(&base64_data) - .unwrap() - .into_boxed_str() - .into_boxed_bytes(), - ); let fut = worker + .post_message( + serde_json::to_string(&base64_data) + .unwrap() + .into_boxed_str() + .into_boxed_bytes(), + ) + .then(|_| worker) .then(move |result| { if let Err(err) = result { // TODO(ry) Need to forward the error instead of exiting. |