Upgrade to Tokio 1.0.0 ecosystem (#530)
* Upgrade Tonic to Tokio 1.0 Work in progress for updating Tonic to Tokio 1.0. Since tower has not been released to crates.io, a git dependency is taken instead. * Upgrade Tonic to Tokio 1.0 phase 2 * tonic: remove tower-* deps * Apply suggestions from code review Co-authored-by: Ed Marshall <[email protected]> Co-authored-by: Lucio Franco <[email protected]>
This commit is contained in:
co-authored by
Ed Marshall
Lucio Franco
parent
fe4d5b9d9a
commit
fdda5ae26a
@@ -10,7 +10,7 @@ license = "MIT"
|
||||
|
||||
[dependencies]
|
||||
tonic = { path= "../../tonic" }
|
||||
prost = "0.6"
|
||||
prost = "0.7"
|
||||
|
||||
[build-dependencies]
|
||||
tonic-build = { path= "../../tonic-build" }
|
||||
|
||||
@@ -10,8 +10,8 @@ license = "MIT"
|
||||
|
||||
[dependencies]
|
||||
tonic = { path= "../../../tonic" }
|
||||
prost = "0.6"
|
||||
prost-types = "0.6"
|
||||
prost = "0.7"
|
||||
prost-types = "0.7"
|
||||
uuid = { package = "uuid1", path= "../uuid" }
|
||||
|
||||
[build-dependencies]
|
||||
|
||||
@@ -9,7 +9,7 @@ license = "MIT"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
prost = "0.6"
|
||||
bytes = "0.5"
|
||||
prost = "0.7"
|
||||
bytes = "1.0"
|
||||
[build-dependencies]
|
||||
prost-build = "0.6"
|
||||
prost-build = "0.7"
|
||||
|
||||
@@ -10,7 +10,7 @@ license = "MIT"
|
||||
|
||||
[dependencies]
|
||||
tonic = { path = "../../tonic" }
|
||||
prost = "0.6"
|
||||
prost = "0.7"
|
||||
|
||||
[build-dependencies]
|
||||
tonic-build = { path = "../../tonic-build" }
|
||||
|
||||
@@ -10,12 +10,12 @@ license = "MIT"
|
||||
|
||||
[dependencies]
|
||||
tonic = { path = "../../tonic" }
|
||||
prost = "0.6"
|
||||
prost = "0.7"
|
||||
futures-util = "0.3"
|
||||
bytes = "0.5"
|
||||
bytes = "1.0"
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { version = "0.2", features = ["macros", "rt-core", "tcp"] }
|
||||
tokio = { version = "1.0", features = ["macros", "rt-multi-thread", "net"] }
|
||||
|
||||
[build-dependencies]
|
||||
tonic-build = { path = "../../tonic-build" }
|
||||
|
||||
@@ -41,14 +41,14 @@ async fn connect_returns_err_via_call_after_connected() {
|
||||
.unwrap();
|
||||
});
|
||||
|
||||
tokio::time::delay_for(Duration::from_millis(100)).await;
|
||||
tokio::time::sleep(Duration::from_millis(100)).await;
|
||||
|
||||
let mut client = TestClient::connect("http://127.0.0.1:1338").await.unwrap();
|
||||
|
||||
// First call should pass, then shutdown the server
|
||||
client.unary_call(Request::new(Input {})).await.unwrap();
|
||||
|
||||
tokio::time::delay_for(Duration::from_millis(100)).await;
|
||||
tokio::time::sleep(Duration::from_millis(100)).await;
|
||||
|
||||
let res = client.unary_call(Request::new(Input {})).await;
|
||||
|
||||
@@ -81,11 +81,11 @@ async fn connect_lazy_reconnects_after_first_failure() {
|
||||
.unwrap();
|
||||
});
|
||||
|
||||
tokio::time::delay_for(Duration::from_millis(100)).await;
|
||||
tokio::time::sleep(Duration::from_millis(100)).await;
|
||||
client.unary_call(Request::new(Input {})).await.unwrap();
|
||||
|
||||
// The server shut down, third call should fail
|
||||
tokio::time::delay_for(Duration::from_millis(100)).await;
|
||||
tokio::time::sleep(Duration::from_millis(100)).await;
|
||||
client.unary_call(Request::new(Input {})).await.unwrap_err();
|
||||
|
||||
jh.await.unwrap();
|
||||
|
||||
@@ -33,7 +33,7 @@ async fn status_with_details() {
|
||||
.unwrap();
|
||||
});
|
||||
|
||||
tokio::time::delay_for(Duration::from_millis(100)).await;
|
||||
tokio::time::sleep(Duration::from_millis(100)).await;
|
||||
|
||||
let mut channel = test_client::TestClient::connect("http://127.0.0.1:1337")
|
||||
.await
|
||||
@@ -87,7 +87,7 @@ async fn status_with_metadata() {
|
||||
.unwrap();
|
||||
});
|
||||
|
||||
tokio::time::delay_for(Duration::from_millis(100)).await;
|
||||
tokio::time::sleep(Duration::from_millis(100)).await;
|
||||
|
||||
let mut channel = test_client::TestClient::connect("http://127.0.0.1:1338")
|
||||
.await
|
||||
|
||||
@@ -33,7 +33,7 @@ async fn writes_user_agent_header() {
|
||||
.unwrap();
|
||||
});
|
||||
|
||||
tokio::time::delay_for(Duration::from_millis(100)).await;
|
||||
tokio::time::sleep(Duration::from_millis(100)).await;
|
||||
|
||||
let channel = Endpoint::from_static("http://127.0.0.1:1322")
|
||||
.user_agent("my-client")
|
||||
|
||||
@@ -10,7 +10,7 @@ license = "MIT"
|
||||
|
||||
[dependencies]
|
||||
tonic = { path = "../../tonic" }
|
||||
prost = "0.6"
|
||||
prost = "0.7"
|
||||
|
||||
[build-dependencies]
|
||||
tonic-build = { path = "../../tonic-build" }
|
||||
|
||||
@@ -10,8 +10,8 @@ license = "MIT"
|
||||
|
||||
[dependencies]
|
||||
tonic = { path = "../../tonic" }
|
||||
prost = "0.6"
|
||||
prost-types = "0.6"
|
||||
prost = "0.7"
|
||||
prost-types = "0.7"
|
||||
|
||||
[build-dependencies]
|
||||
tonic-build = { path = "../../tonic-build" }
|
||||
|
||||
Reference in New Issue
Block a user