Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bring back push_ fns for a few missing layers #491

Merged
merged 1 commit into from
Apr 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion linkerd/app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ tokio-io = "0.1.6"
tokio-current-thread = "0.1.4"
tokio-rustls = "0.10"
tower = "0.1"
webpki = "0.21"
webpki = "=0.21.0"
1 change: 1 addition & 0 deletions linkerd/app/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ features = [
"util",
"make",
"timeout",
"spawn-ready"
]

[target.'cfg(target_os = "linux")'.dependencies]
Expand Down
28 changes: 14 additions & 14 deletions linkerd/app/core/src/svc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ use std::task::{Context, Poll};
use std::time::Duration;
use tower::layer::util::{Identity, Stack as Pair};
pub use tower::layer::Layer;
pub use tower::make::MakeService;
use tower::spawn_ready::SpawnReadyLayer;
pub use tower::util::{Either, Oneshot};
pub use tower::{service_fn as mk, Service, ServiceExt};
pub use tower_make::MakeService;
use tower_spawn_ready::SpawnReadyLayer;

#[derive(Clone, Debug)]
pub struct Layers<L>(L);
Expand Down Expand Up @@ -182,10 +182,10 @@ impl<S> Stack<S> {
self.push(InstrumentMakeLayer::from_target())
}

// /// Wraps an inner `MakeService` to be a `NewService`.
// pub fn into_new_service(self) -> Stack<stack::new_service::FromMakeService<S>> {
// self.push(stack::new_service::FromMakeServiceLayer::default())
// }
/// Wraps an inner `MakeService` to be a `NewService`.
pub fn into_new_service(self) -> Stack<stack::new_service::FromMakeService<S>> {
self.push(stack::new_service::FromMakeServiceLayer::default())
}

pub fn push_make_ready<Req>(self) -> Stack<stack::MakeReady<S, Req>> {
self.push(stack::MakeReadyLayer::new())
Expand All @@ -203,15 +203,15 @@ impl<S> Stack<S> {
self.push(buffer::SpawnBufferLayer::new(capacity))
}

// /// Assuming `S` implements `NewService` or `MakeService`, applies the given
// /// `L`-typed layer on each service produced by `S`.
// pub fn push_on_response<L: Clone>(self, layer: L) -> Stack<stack::OnResponse<L, S>> {
// self.push(stack::OnResponseLayer::new(layer))
// }
/// Assuming `S` implements `NewService` or `MakeService`, applies the given
/// `L`-typed layer on each service produced by `S`.
pub fn push_on_response<L: Clone>(self, layer: L) -> Stack<stack::OnResponse<L, S>> {
self.push(stack::OnResponseLayer::new(layer))
}

// pub fn push_spawn_ready(self) -> Stack<tower_spawn_ready::MakeSpawnReady<S>> {
// self.push(SpawnReadyLayer::new())
// }
pub fn push_spawn_ready(self) -> Stack<tower::spawn_ready::MakeSpawnReady<S>> {
self.push(SpawnReadyLayer::new())
}

// pub fn push_concurrency_limit(
// self,
Expand Down