Skip to content

Commit

Permalink
chore(examples): Remove timeout from tower example (#2030)
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto authored Nov 6, 2024
1 parent c84e952 commit b80428b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ tracing = ["dep:tracing", "dep:tracing-subscriber"]
uds = ["tokio-stream/net", "dep:tower", "dep:hyper", "dep:hyper-util"]
streaming = ["tokio-stream", "dep:h2"]
mock = ["tokio-stream", "dep:tower", "dep:hyper-util"]
tower = ["dep:tower", "tower?/timeout", "dep:http"]
tower = ["dep:tower", "dep:http"]
json-codec = ["dep:serde", "dep:serde_json", "dep:bytes"]
compression = ["tonic/gzip"]
tls = ["tonic/tls"]
Expand Down
3 changes: 0 additions & 3 deletions examples/src/tower/server.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::{
pin::Pin,
task::{Context, Poll},
time::Duration,
};
use tonic::{transport::Server, Request, Response, Status};
use tower::{Layer, Service};
Expand Down Expand Up @@ -42,8 +41,6 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

// The stack of middleware that our service will be wrapped in
let layer = tower::ServiceBuilder::new()
// Apply middleware from tower
.timeout(Duration::from_secs(30))
// Apply our own middleware
.layer(MyMiddlewareLayer::default())
// Interceptors can be also be applied as middleware
Expand Down

0 comments on commit b80428b

Please sign in to comment.