summaryrefslogtreecommitdiff
path: root/cli/tokio_util.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/tokio_util.rs
parent99186dbaa25c5715103f6a0e0df9fae9488470b3 (diff)
Enable thread pool for blocking ops (#3912)
Diffstat (limited to 'cli/tokio_util.rs')
-rw-r--r--cli/tokio_util.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/cli/tokio_util.rs b/cli/tokio_util.rs
index 6ffc57b1a..e5878cdf7 100644
--- a/cli/tokio_util.rs
+++ b/cli/tokio_util.rs
@@ -1,5 +1,4 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
-use futures::Future;
// TODO(ry) rename to run_local ?
pub fn run_basic<F, R>(future: F) -> R
@@ -15,7 +14,9 @@ where
rt.block_on(future)
}
-pub fn spawn_thread<F, R>(f: F) -> impl Future<Output = R>
+// TODO(ry) maybe replace with tokio::task::spawn_blocking
+#[cfg(test)]
+pub fn spawn_thread<F, R>(f: F) -> impl std::future::Future<Output = R>
where
F: 'static + Send + FnOnce() -> R,
R: 'static + Send,