diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2021-01-12 08:50:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-11 23:50:02 -0800 |
commit | 275a5c65a20529cd4a3d775b8d8c6e9b261c76b1 (patch) | |
tree | 9f861e36e70be809d5586128a24b9f7b4332e09e /cli/tools/repl.rs | |
parent | 36ff7bdf575e0547fabd8957ee778cc4224d5956 (diff) |
upgrade: tokio 1.0 (#8779)
Co-authored-by: Bert Belder <bertbelder@gmail.com>
Diffstat (limited to 'cli/tools/repl.rs')
-rw-r--r-- | cli/tools/repl.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cli/tools/repl.rs b/cli/tools/repl.rs index e59fd57a8..cf5c0e983 100644 --- a/cli/tools/repl.rs +++ b/cli/tools/repl.rs @@ -6,6 +6,7 @@ use crate::colors; use crate::media_type::MediaType; use crate::program_state::ProgramState; use deno_core::error::AnyError; +use deno_core::futures::FutureExt; use deno_core::serde_json::json; use deno_core::serde_json::Value; use deno_runtime::inspector::InspectorSession; @@ -277,7 +278,7 @@ async fn post_message_and_poll( // A zero delay is long enough to yield the thread in order to prevent the loop from // running hot for messages that are taking longer to resolve like for example an // evaluation of top level await. - tokio::time::delay_for(tokio::time::Duration::from_millis(0)).await; + tokio::time::sleep(tokio::time::Duration::from_millis(0)).await; } } } @@ -305,7 +306,7 @@ async fn read_line_and_poll( // Because an inspector websocket client may choose to connect at anytime when we have an // inspector server we need to keep polling the worker to pick up new connections. let mut timeout = - tokio::time::delay_for(tokio::time::Duration::from_millis(100)); + tokio::time::sleep(tokio::time::Duration::from_millis(100)).boxed_local(); tokio::select! { result = &mut line => { |