summaryrefslogtreecommitdiff
path: root/cli/tokio_util.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2021-01-12 08:50:02 +0100
committerGitHub <noreply@github.com>2021-01-11 23:50:02 -0800
commit275a5c65a20529cd4a3d775b8d8c6e9b261c76b1 (patch)
tree9f861e36e70be809d5586128a24b9f7b4332e09e /cli/tokio_util.rs
parent36ff7bdf575e0547fabd8957ee778cc4224d5956 (diff)
upgrade: tokio 1.0 (#8779)
Co-authored-by: Bert Belder <bertbelder@gmail.com>
Diffstat (limited to 'cli/tokio_util.rs')
-rw-r--r--cli/tokio_util.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/cli/tokio_util.rs b/cli/tokio_util.rs
index ef0ba5be3..5ee45325d 100644
--- a/cli/tokio_util.rs
+++ b/cli/tokio_util.rs
@@ -1,8 +1,7 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
pub fn create_basic_runtime() -> tokio::runtime::Runtime {
- tokio::runtime::Builder::new()
- .basic_scheduler()
+ tokio::runtime::Builder::new_current_thread()
.enable_io()
.enable_time()
// This limits the number of threads for blocking operations (like for
@@ -10,7 +9,7 @@ pub fn create_basic_runtime() -> tokio::runtime::Runtime {
// parallel for deno fmt.
// The default value is 512, which is an unhelpfully large thread pool. We
// don't ever want to have more than a couple dozen threads.
- .max_threads(32)
+ .max_blocking_threads(32)
.build()
.unwrap()
}
@@ -20,6 +19,6 @@ pub fn run_basic<F, R>(future: F) -> R
where
F: std::future::Future<Output = R>,
{
- let mut rt = create_basic_runtime();
+ let rt = create_basic_runtime();
rt.block_on(future)
}