File tree 4 files changed +23
-2
lines changed 4 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,10 @@ impl ResultsHook for Results {
126
126
}
127
127
}
128
128
129
+ fn on_tail_call ( & mut self ) -> Promise < any_pointer:: Pipeline , crate :: Error > {
130
+ todo ! ( )
131
+ }
132
+
129
133
fn tail_call ( self : Box < Self > , _request : Box < dyn RequestHook > ) -> Promise < ( ) , Error > {
130
134
unimplemented ! ( )
131
135
}
Original file line number Diff line number Diff line change @@ -2176,6 +2176,7 @@ where
2176
2176
variant : Option < ResultsVariant > ,
2177
2177
redirect_results : bool ,
2178
2178
answer_id : AnswerId ,
2179
+ tail_call_pipeline_fulfiller : Option < oneshot:: Sender < any_pointer:: Pipeline > > ,
2179
2180
finish_received : Rc < Cell < bool > > ,
2180
2181
}
2181
2182
@@ -2239,6 +2240,7 @@ where
2239
2240
redirect_results,
2240
2241
answer_id,
2241
2242
finish_received,
2243
+ tail_call_pipeline_fulfiller : None ,
2242
2244
} ) ,
2243
2245
results_done_fulfiller : Some ( fulfiller) ,
2244
2246
}
@@ -2293,8 +2295,14 @@ impl<VatId> ResultsHook for Results<VatId> {
2293
2295
}
2294
2296
}
2295
2297
2296
- fn tail_call ( self : Box < Self > , _request : Box < dyn RequestHook > ) -> Promise < ( ) , Error > {
2297
- unimplemented ! ( )
2298
+ fn on_tail_call ( & mut self ) -> Promise < any_pointer:: Pipeline , crate :: Error > {
2299
+ todo ! ( )
2300
+ }
2301
+
2302
+ fn tail_call ( self : Box < Self > , request : Box < dyn RequestHook > ) -> Promise < ( ) , Error > {
2303
+ let ( promise, pipeline) = self . direct_tail_call ( request) ;
2304
+ // TODO somehow send pipeline to tail_call_pipeline_fulfiller
2305
+ promise
2298
2306
}
2299
2307
2300
2308
fn direct_tail_call (
Original file line number Diff line number Diff line change @@ -239,6 +239,12 @@ where
239
239
pub fn set ( & mut self , other : T :: Reader < ' _ > ) -> crate :: Result < ( ) > {
240
240
self . hook . get ( ) . unwrap ( ) . set_as ( other)
241
241
}
242
+
243
+ pub fn tail_call < SubParams > ( self , tail_request : Request < SubParams , T > )
244
+ -> Promise < ( ) , Error >
245
+ {
246
+ self . hook . tail_call ( tail_request. hook )
247
+ }
242
248
}
243
249
244
250
pub trait FromTypelessPipeline {
Original file line number Diff line number Diff line change @@ -94,6 +94,9 @@ impl Clone for Box<dyn ClientHook> {
94
94
pub trait ResultsHook {
95
95
fn get ( & mut self ) -> crate :: Result < any_pointer:: Builder < ' _ > > ;
96
96
fn allow_cancellation ( & self ) ;
97
+
98
+ fn on_tail_call ( & mut self ) -> Promise < any_pointer:: Pipeline , crate :: Error > ;
99
+
97
100
fn tail_call ( self : Box < Self > , request : Box < dyn RequestHook > ) -> Promise < ( ) , crate :: Error > ;
98
101
fn direct_tail_call (
99
102
self : Box < Self > ,
You can’t perform that action at this time.
0 commit comments