diff --git a/Cargo.toml b/Cargo.toml index 6bb2f91e..f39c1bca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,16 +59,14 @@ features = [ ] [dependencies.tokio] -version = "0.2" +version = "1.0" default-features = false features = [ "process", "io-std", "io-util", - "rt-threaded", - "blocking", + "rt-multi-thread", "sync", - "stream", "time", "macros", ] diff --git a/src/async_turtle.rs b/src/async_turtle.rs index a99eee1b..055c01f0 100644 --- a/src/async_turtle.rs +++ b/src/async_turtle.rs @@ -98,7 +98,7 @@ impl AsyncTurtle { return; } - time::delay_for(time::Duration::from_millis((secs * 1000.0) as u64)).await + time::sleep(time::Duration::from_millis((secs * 1000.0) as u64)).await } pub async fn arc_left(&mut self, radius: Distance, extent: Angle) { diff --git a/src/ipc_protocol/async_ipc_receiver.rs b/src/ipc_protocol/async_ipc_receiver.rs index 7d3f0f86..d3822122 100644 --- a/src/ipc_protocol/async_ipc_receiver.rs +++ b/src/ipc_protocol/async_ipc_receiver.rs @@ -30,7 +30,7 @@ impl AsyncIpcReceiver { // disconnected. This allows callers of `recv` to detect the disconnection. let next_value = ipc_receiver.recv(); - let value_sender: oneshot::Sender<_> = match handle.block_on(receiver.recv()) { + let value_sender: oneshot::Sender<_> = match receiver.blocking_recv() { Some(value_sender) => value_sender, // The sender for this channel only drops when the main thread has stopped, // so it's pretty safe to stop here diff --git a/src/renderer_server/animation.rs b/src/renderer_server/animation.rs index 5215b464..df84d517 100644 --- a/src/renderer_server/animation.rs +++ b/src/renderer_server/animation.rs @@ -483,7 +483,7 @@ async fn animation_loop( }, // Trigger an update once the next update time has elapsed - _ = time::delay_until(next_update) => { + _ = time::sleep_until(next_update) => { let now = time::Instant::now(); handle_handler_result(update_animations( diff --git a/src/renderer_server/main.rs b/src/renderer_server/main.rs index de0c81ce..2202bb3c 100644 --- a/src/renderer_server/main.rs +++ b/src/renderer_server/main.rs @@ -278,7 +278,7 @@ pub fn run_main( GlutinEvent::LoopDestroyed => { // Notify the server that it should shutdown, ignoring the error if the channel has // been dropped since that just means that the server task has ended already - handle.block_on(server_shutdown.send(())).unwrap_or(()); + server_shutdown.blocking_send(()).unwrap_or(()); }, _ => {},