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

Remove DirectService #160

Merged
merged 1 commit into from
Feb 16, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ members = [
"./",
"tower-balance",
"tower-buffer",
"tower-direct-service",
"tower-discover",
"tower-filter",
"tower-in-flight-limit",
Expand Down
22 changes: 0 additions & 22 deletions tower-direct-service/Cargo.toml

This file was deleted.

25 changes: 0 additions & 25 deletions tower-direct-service/LICENSE

This file was deleted.

36 changes: 0 additions & 36 deletions tower-direct-service/README.md

This file was deleted.

126 changes: 0 additions & 126 deletions tower-direct-service/src/lib.rs

This file was deleted.

3 changes: 1 addition & 2 deletions tower-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ publish = false
[dependencies]
futures = "0.1"
tower-service = { version = "0.2", path = "../tower-service" }
tower-direct-service = { version = "0.1", path = "../tower-direct-service" }
tokio-io = "0.1"
tokio-io = "0.1"
1 change: 0 additions & 1 deletion tower-util/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#[macro_use]
extern crate futures;
extern crate tokio_io;
extern crate tower_direct_service;
extern crate tower_service;

pub mod boxed;
Expand Down
27 changes: 0 additions & 27 deletions tower-util/src/service_fn.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use futures::{IntoFuture, Poll};
use tower_direct_service::DirectService;
use tower_service::Service;

/// A `Service` implemented by a closure.
Expand Down Expand Up @@ -33,29 +32,3 @@ where
(self.f)(req).into_future()
}
}

impl<T, F, Request> DirectService<Request> for ServiceFn<T>
where
T: Fn(Request) -> F,
F: IntoFuture,
{
type Response = F::Item;
type Error = F::Error;
type Future = F::Future;

fn poll_ready(&mut self) -> Poll<(), F::Error> {
Ok(().into())
}

fn poll_service(&mut self) -> Poll<(), F::Error> {
Ok(().into())
}

fn poll_close(&mut self) -> Poll<(), F::Error> {
Ok(().into())
}

fn call(&mut self, req: Request) -> Self::Future {
(self.f)(req).into_future()
}
}