@@ -21,31 +21,24 @@ use tower_service::Service;
2121
2222use  crate :: common:: url:: Url ; 
2323use  crate :: protocol:: Invoker ; 
24- use  crate :: triple:: transport :: connection :: Connection ; 
24+ use  crate :: triple:: client :: builder :: { ClientBoxService ,   ClientBuilder } ; 
2525
26- #[ allow( dead_code) ]  
27- #[ derive( Clone ,  Default ) ]  
2826pub  struct  TripleInvoker  { 
2927    url :  Url , 
30-     conn :  Connection , 
28+     conn :  ClientBoxService , 
3129} 
3230
3331impl  TripleInvoker  { 
3432    pub  fn  new ( url :  Url )  -> TripleInvoker  { 
3533        let  uri = http:: Uri :: from_str ( & url. to_url ( ) ) . unwrap ( ) ; 
3634        Self  { 
3735            url, 
38-             conn :  Connection :: new ( ) . with_host ( uri ) , 
36+             conn :  ClientBuilder :: from ( uri ) . connect ( ) , 
3937        } 
4038    } 
4139} 
4240
43- impl < ReqBody >  Invoker < http:: Request < ReqBody > >  for  TripleInvoker 
44- where 
45-     ReqBody :  http_body:: Body  + Unpin  + Send  + ' static , 
46-     ReqBody :: Error :  Into < crate :: Error > , 
47-     ReqBody :: Data :  Send  + Unpin , 
48- { 
41+ impl  Invoker < http:: Request < hyper:: Body > >  for  TripleInvoker  { 
4942    type  Response  = http:: Response < crate :: BoxBody > ; 
5043
5144    type  Error  = crate :: Error ; 
5649        self . url . clone ( ) 
5750    } 
5851
59-     fn  call ( & mut  self ,  req :  http:: Request < ReqBody > )  -> Self :: Future  { 
52+     fn  call ( & mut  self ,  req :  http:: Request < hyper :: Body > )  -> Self :: Future  { 
6053        self . conn . call ( req) 
6154    } 
55+ 
56+     fn  poll_ready ( 
57+         & mut  self , 
58+         cx :  & mut  std:: task:: Context < ' _ > , 
59+     )  -> std:: task:: Poll < Result < ( ) ,  Self :: Error > >  { 
60+         self . conn . poll_ready ( cx) 
61+     } 
6262} 
0 commit comments