Upgrade to tokio 0.2 (#163)
This commit is contained in:
@@ -71,11 +71,11 @@ tonic = { path = "../tonic", features = ["tls"] }
|
||||
bytes = "0.4"
|
||||
prost = "0.5"
|
||||
|
||||
tokio = "=0.2.0-alpha.6"
|
||||
futures-preview = { version = "=0.3.0-alpha.19", default-features = false, features = ["alloc"]}
|
||||
async-stream = "0.1.2"
|
||||
http = "0.1"
|
||||
tower = "=0.3.0-alpha.2"
|
||||
tokio = { version = "0.2", features = ["rt-threaded", "time", "stream", "fs"] }
|
||||
futures = { version = "0.3", default-features = false, features = ["alloc"]}
|
||||
async-stream = "0.2"
|
||||
http = "0.2"
|
||||
tower = { git = "https://github.com/tower-rs/tower" }
|
||||
|
||||
# Required for routeguide
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
|
||||
@@ -60,7 +60,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
for addr in &addrs {
|
||||
let addr = addr.parse()?;
|
||||
let mut tx = tx.clone();
|
||||
let tx = tx.clone();
|
||||
|
||||
let server = EchoServer { addr };
|
||||
let serve = Server::builder()
|
||||
@@ -72,7 +72,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
eprintln!("Error = {:?}", e);
|
||||
}
|
||||
|
||||
tx.try_send(()).unwrap();
|
||||
tx.send(()).unwrap();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ use rand::rngs::ThreadRng;
|
||||
use rand::Rng;
|
||||
use route_guide::{Point, Rectangle, RouteNote};
|
||||
use std::error::Error;
|
||||
use std::time::{Duration, Instant};
|
||||
use tokio::timer::Interval;
|
||||
use std::time::Duration;
|
||||
use tokio::time::Instant;
|
||||
use tonic::transport::Channel;
|
||||
use tonic::Request;
|
||||
|
||||
@@ -62,9 +62,9 @@ async fn run_route_chat(client: &mut RouteGuideClient<Channel>) -> Result<(), Bo
|
||||
let start = Instant::now();
|
||||
|
||||
let outbound = async_stream::stream! {
|
||||
let mut interval = Interval::new_interval(Duration::from_secs(1));
|
||||
let mut interval = tokio::time::interval(Duration::from_secs(1));
|
||||
|
||||
while let Some(time) = interval.next().await {
|
||||
while let time = interval.tick().await {
|
||||
let elapsed = time.duration_since(start);
|
||||
let note = RouteNote {
|
||||
location: Some(Point {
|
||||
|
||||
Reference in New Issue
Block a user