From 724e39f13f2f144703ce00e156cacfc653d8e209 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Fri, 7 Feb 2020 17:54:44 -0500 Subject: Enable thread pool for blocking ops (#3912) --- cli/tokio_util.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cli/tokio_util.rs') 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(future: F) -> R @@ -15,7 +14,9 @@ where rt.block_on(future) } -pub fn spawn_thread(f: F) -> impl Future +// TODO(ry) maybe replace with tokio::task::spawn_blocking +#[cfg(test)] +pub fn spawn_thread(f: F) -> impl std::future::Future where F: 'static + Send + FnOnce() -> R, R: 'static + Send, -- cgit v1.2.3