yang20150702 commented on code in PR #166:
URL: https://github.com/apache/dubbo-rust/pull/166#discussion_r1400762072
##########
dubbo/src/loadbalancer/mod.rs:
##########
@@ -40,59 +44,50 @@ where
let svc = self.inner.new_service(target);
LoadBalancer {
- inner: svc
+ inner: svc,
}
}
}
-impl<N, Req, Nsv> Service<Req> for LoadBalancer<N>
+impl<N> Service<http::Request<CloneBody>> for LoadBalancer<N>
where
- Req: Send + 'static,
// Routes service
- N: Service<(), Response = Vec<Nsv>> + Clone,
+ N: Service<(), Response = Vec<CloneInvoker<TripleInvoker>>> + Clone,
N::Error: Into<StdError> + Send,
N::Future: Send + 'static,
- // new invoker
- Nsv: NewService<()> + Send,
- Nsv::Service: Service<Req> + Send,
- // invoker
- <Nsv::Service as Service<Req>>::Error: Into<StdError> + Send,
- <Nsv::Service as Service<Req>>::Future: Send + 'static,
{
- type Response = <Nsv::Service as Service<Req>>::Response;
+ type Response = <CloneInvoker<TripleInvoker> as
Service<http::Request<CloneBody>>>::Response;
type Error = StdError;
type Future = BoxFuture<'static, Result<Self::Response, Self::Error>>;
fn poll_ready(&mut self, cx: &mut std::task::Context<'_>) ->
std::task::Poll<Result<(), Self::Error>> {
self.inner.poll_ready(cx).map_err(Into::into)
-
+
}
- fn call(&mut self, req: Req) -> Self::Future {
+ fn call(&mut self, req: http::Request<CloneBody>) -> Self::Future {
let routes = self.inner.call(());
let fut = async move {
let routes = routes.await;
- let routes: Vec<Nsv> = match routes {
+ let routes: Vec<CloneInvoker<TripleInvoker>> = match routes {
Err(e) => return Err(Into::<StdError>::into(e)),
Ok(routes) => routes
};
-
- let service_list: Vec<_> = routes.iter().map(|inv| {
- let invoker = inv.new_service(());
+
+ let service_list: Vec<_> = routes. into_iter().map(|invoker| {
Review Comment:
去掉空格
##########
dubbo/src/loadbalancer/mod.rs:
##########
@@ -40,59 +44,50 @@ where
let svc = self.inner.new_service(target);
LoadBalancer {
- inner: svc
+ inner: svc,
}
}
}
-impl<N, Req, Nsv> Service<Req> for LoadBalancer<N>
+impl<N> Service<http::Request<CloneBody>> for LoadBalancer<N>
where
- Req: Send + 'static,
// Routes service
- N: Service<(), Response = Vec<Nsv>> + Clone,
+ N: Service<(), Response = Vec<CloneInvoker<TripleInvoker>>> + Clone,
N::Error: Into<StdError> + Send,
N::Future: Send + 'static,
- // new invoker
- Nsv: NewService<()> + Send,
- Nsv::Service: Service<Req> + Send,
- // invoker
- <Nsv::Service as Service<Req>>::Error: Into<StdError> + Send,
- <Nsv::Service as Service<Req>>::Future: Send + 'static,
{
- type Response = <Nsv::Service as Service<Req>>::Response;
+ type Response = <CloneInvoker<TripleInvoker> as
Service<http::Request<CloneBody>>>::Response;
type Error = StdError;
type Future = BoxFuture<'static, Result<Self::Response, Self::Error>>;
fn poll_ready(&mut self, cx: &mut std::task::Context<'_>) ->
std::task::Poll<Result<(), Self::Error>> {
self.inner.poll_ready(cx).map_err(Into::into)
-
+
}
- fn call(&mut self, req: Req) -> Self::Future {
+ fn call(&mut self, req: http::Request<CloneBody>) -> Self::Future {
let routes = self.inner.call(());
let fut = async move {
let routes = routes.await;
- let routes: Vec<Nsv> = match routes {
+ let routes: Vec<CloneInvoker<TripleInvoker>> = match routes {
Err(e) => return Err(Into::<StdError>::into(e)),
Ok(routes) => routes
};
-
- let service_list: Vec<_> = routes.iter().map(|inv| {
- let invoker = inv.new_service(());
+
+ let service_list: Vec<_> = routes. into_iter().map(|invoker| {
Review Comment:
去掉空格
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]