File tree Expand file tree Collapse file tree 4 files changed +23
-2
lines changed Expand file tree Collapse file tree 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 {
126126 }
127127 }
128128
129+ fn on_tail_call ( & mut self ) -> Promise < any_pointer:: Pipeline , crate :: Error > {
130+ todo ! ( )
131+ }
132+
129133 fn tail_call ( self : Box < Self > , _request : Box < dyn RequestHook > ) -> Promise < ( ) , Error > {
130134 unimplemented ! ( )
131135 }
Original file line number Diff line number Diff line change @@ -2176,6 +2176,7 @@ where
21762176 variant : Option < ResultsVariant > ,
21772177 redirect_results : bool ,
21782178 answer_id : AnswerId ,
2179+ tail_call_pipeline_fulfiller : Option < oneshot:: Sender < any_pointer:: Pipeline > > ,
21792180 finish_received : Rc < Cell < bool > > ,
21802181}
21812182
@@ -2239,6 +2240,7 @@ where
22392240 redirect_results,
22402241 answer_id,
22412242 finish_received,
2243+ tail_call_pipeline_fulfiller : None ,
22422244 } ) ,
22432245 results_done_fulfiller : Some ( fulfiller) ,
22442246 }
@@ -2293,8 +2295,14 @@ impl<VatId> ResultsHook for Results<VatId> {
22932295 }
22942296 }
22952297
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
22982306 }
22992307
23002308 fn direct_tail_call (
Original file line number Diff line number Diff line change @@ -239,6 +239,12 @@ where
239239 pub fn set ( & mut self , other : T :: Reader < ' _ > ) -> crate :: Result < ( ) > {
240240 self . hook . get ( ) . unwrap ( ) . set_as ( other)
241241 }
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+ }
242248}
243249
244250pub trait FromTypelessPipeline {
Original file line number Diff line number Diff line change @@ -94,6 +94,9 @@ impl Clone for Box<dyn ClientHook> {
9494pub trait ResultsHook {
9595 fn get ( & mut self ) -> crate :: Result < any_pointer:: Builder < ' _ > > ;
9696 fn allow_cancellation ( & self ) ;
97+
98+ fn on_tail_call ( & mut self ) -> Promise < any_pointer:: Pipeline , crate :: Error > ;
99+
97100 fn tail_call ( self : Box < Self > , request : Box < dyn RequestHook > ) -> Promise < ( ) , crate :: Error > ;
98101 fn direct_tail_call (
99102 self : Box < Self > ,
You can’t perform that action at this time.
0 commit comments