Skip to content

Commit 49f91d7

Browse files
committed
Starting to upgrade to tokio 0.3
1 parent 79635ea commit 49f91d7

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,13 @@ features = [
5959
]
6060

6161
[dependencies.tokio]
62-
version = "0.2"
62+
version = "0.3"
6363
default-features = false
6464
features = [
6565
"process",
6666
"io-std",
6767
"io-util",
68-
"rt-threaded",
69-
"blocking",
68+
"rt-multi-thread",
7069
"sync",
7170
"stream",
7271
"time",

src/async_turtle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl AsyncTurtle {
9898
return;
9999
}
100100

101-
time::delay_for(time::Duration::from_millis((secs * 1000.0) as u64)).await
101+
time::sleep(time::Duration::from_millis((secs * 1000.0) as u64)).await
102102
}
103103

104104
pub async fn arc_left(&mut self, radius: Distance, extent: Angle) {

src/ipc_protocol/async_ipc_receiver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ impl<T: Serialize + DeserializeOwned + Send + 'static> AsyncIpcReceiver<T> {
3030
// disconnected. This allows callers of `recv` to detect the disconnection.
3131
let next_value = ipc_receiver.recv();
3232

33-
let value_sender: oneshot::Sender<_> = match handle.block_on(receiver.recv()) {
33+
let value_sender: oneshot::Sender<_> = match receiver.blocking_recv() {
3434
Some(value_sender) => value_sender,
3535
// The sender for this channel only drops when the main thread has stopped,
3636
// so it's pretty safe to stop here

src/renderer_server/animation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ async fn animation_loop(
483483
},
484484

485485
// Trigger an update once the next update time has elapsed
486-
_ = time::delay_until(next_update) => {
486+
_ = time::sleep_until(next_update) => {
487487
let now = time::Instant::now();
488488

489489
handle_handler_result(update_animations(

0 commit comments

Comments
 (0)