@@ -12,7 +12,7 @@ pub trait ChainPollParallel<Output>: Send {
1212 self : Pin < & mut Self > ,
1313 cx : & mut Context < ' _ > ,
1414 tail_ready : bool ,
15- storage : & mut Storage ,
15+ storage_acc : & mut Vec < Storage > ,
1616 ) -> Poll < Output > ;
1717}
1818
@@ -28,19 +28,19 @@ where
2828 self : Pin < & mut Self > ,
2929 cx : & mut Context < ' _ > ,
3030 tail_ready : bool ,
31- storage : & mut Storage ,
31+ storage_acc : & mut Vec < Storage > ,
3232 ) -> Poll < Result < ( HeadOutput , TailOutput ) , Error > > {
3333 let ( head, tail) = unsafe { self . get_unchecked_mut ( ) } ;
3434 let ( head, mut tail) = unsafe { ( Pin :: new_unchecked ( head) , Pin :: new_unchecked ( tail) ) } ;
3535 let tail_ready = tail. as_mut ( ) . poll ( cx) . is_ready ( ) && tail_ready;
3636
37- let Poll :: Ready ( res) = ChainPollParallel :: poll ( head, cx, tail_ready, storage ) else {
37+ let Poll :: Ready ( res) = ChainPollParallel :: poll ( head, cx, tail_ready, storage_acc ) else {
3838 return Poll :: Pending ;
3939 } ;
4040 match res {
4141 Ok ( head_out) => match tail. take_output ( ) . unwrap ( ) {
4242 Ok ( ( tail_out, node_storage) ) => {
43- // TODO: merge storage
43+ storage_acc . push ( node_storage ) ;
4444 Poll :: Ready ( Ok ( ( head_out, tail_out) ) )
4545 }
4646 Err ( e) => Poll :: Ready ( Err ( e) ) ,
@@ -60,13 +60,13 @@ where
6060 self : Pin < & mut Self > ,
6161 cx : & mut Context < ' _ > ,
6262 tail_ready : bool ,
63- storage : & mut Storage ,
63+ storage_acc : & mut Vec < Storage > ,
6464 ) -> Poll < Result < ( HeadOutput , ) , Error > > {
6565 let mut head = unsafe { Pin :: new_unchecked ( & mut self . get_unchecked_mut ( ) . 0 ) } ;
6666 if head. as_mut ( ) . poll ( cx) . is_ready ( ) && tail_ready {
6767 match head. take_output ( ) . unwrap ( ) {
6868 Ok ( ( output, node_storage) ) => {
69- // TODO: merge storage
69+ storage_acc . push ( node_storage ) ;
7070 Poll :: Ready ( Ok ( ( output, ) ) )
7171 }
7272 Err ( e) => Poll :: Ready ( Err ( e) ) ,
0 commit comments