Commit bd9f1cb 1 parent 852a10c commit bd9f1cb Copy full SHA for bd9f1cb
File tree 3 files changed +21
-2
lines changed
entrypoint/ampc/shortest_path
3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 98
98
Ok ( res)
99
99
}
100
100
101
+ fn send_raw_without_timeout ( & self , req : & JobReq < Self :: Job > ) -> Result < JobResp < Self :: Job > > {
102
+ let mut conn = self . conn ( ) ?;
103
+ let res = block_on ( conn. send_without_timeout ( req) ) ?;
104
+ Ok ( res)
105
+ }
106
+
101
107
fn send < R > ( & self , req : R ) -> R :: Response
102
108
where
103
109
R : RequestWrapper < <Self :: Job as Job >:: Worker > ,
@@ -107,6 +113,19 @@ where
107
113
Resp :: User ( res) => R :: unwrap_response ( res) . unwrap ( ) ,
108
114
}
109
115
}
116
+
117
+ fn send_without_timeout < R > ( & self , req : R ) -> R :: Response
118
+ where
119
+ R : RequestWrapper < <Self :: Job as Job >:: Worker > ,
120
+ {
121
+ match self
122
+ . send_raw_without_timeout ( & Req :: User ( R :: wrap ( req) ) )
123
+ . unwrap ( )
124
+ {
125
+ Resp :: Coordinator ( _) => panic ! ( "unexpected coordinator response" ) ,
126
+ Resp :: User ( res) => R :: unwrap_response ( res) . unwrap ( ) ,
127
+ }
128
+ }
110
129
}
111
130
112
131
pub trait RequestWrapper < W : Worker > : Message < W > {
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ where
119
119
}
120
120
}
121
121
122
- async fn send_without_timeout ( & mut self , request : & Req ) -> Result < Res > {
122
+ pub async fn send_without_timeout ( & mut self , request : & Req ) -> Result < Res > {
123
123
self . awaiting_res = true ;
124
124
let bytes = bincode:: encode_to_vec ( request, common:: bincode_config ( ) ) . unwrap ( ) ;
125
125
Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ impl RemoteShortestPathWorker {
175
175
}
176
176
177
177
pub fn sample_nodes ( & self , num_nodes : u64 ) -> Vec < webgraph:: NodeID > {
178
- self . send ( SampleNodes ( num_nodes) )
178
+ self . send_without_timeout ( SampleNodes ( num_nodes) )
179
179
}
180
180
}
181
181
You can’t perform that action at this time.
0 commit comments