summaryrefslogtreecommitdiff
path: root/cli/ops/dispatch_json.rs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2020-02-07 17:54:44 -0500
committerGitHub <noreply@github.com>2020-02-07 17:54:44 -0500
commit724e39f13f2f144703ce00e156cacfc653d8e209 (patch)
treed6ee7f37fef3dfb0326d6c262e358a7f404d98fe /cli/ops/dispatch_json.rs
parent99186dbaa25c5715103f6a0e0df9fae9488470b3 (diff)
Enable thread pool for blocking ops (#3912)
Diffstat (limited to 'cli/ops/dispatch_json.rs')
-rw-r--r--cli/ops/dispatch_json.rs10
1 files changed, 1 insertions, 9 deletions
diff --git a/cli/ops/dispatch_json.rs b/cli/ops/dispatch_json.rs
index 0806001ab..60c57ef67 100644
--- a/cli/ops/dispatch_json.rs
+++ b/cli/ops/dispatch_json.rs
@@ -103,15 +103,7 @@ where
if is_sync {
Ok(JsonOp::Sync(f()?))
} else {
- // TODO(ry) use thread pool.
- let fut = crate::tokio_util::spawn_thread(f);
- /*
- let fut = async move {
- tokio::task::spawn_blocking(move || f())
- .await
- .map_err(ErrBox::from)?
- }.boxed_local();
- */
+ let fut = async move { tokio::task::spawn_blocking(f).await.unwrap() };
Ok(JsonOp::Async(fut.boxed_local()))
}
}