gohalo commented on PR #124:
URL: https://github.com/apache/hudi-rs/pull/124#issuecomment-2511421421

   @xushiyan just blocked by the following code 
[crates/core/src/table/fs_view.rs#L134](https://github.com/gohalo/hudi-rs/blob/8413a3a0f9e3cf1e7f174be7172321ac22b36d7a/crates/core/src/table/fs_view.rs#L134),
 do you have any ideas how to fix this one.
   
   The following code just works fine.
   
   ``` rust
   use futures::stream::{StreamExt, TryStreamExt};
   use std::collections::HashSet;
   use std::time::Duration;
   use tokio::time::sleep;
   
   #[derive(Debug)]
   pub enum Error {
       Internal(String),
   }
   type Result<T, E = Error> = std::result::Result<T, E>;
   
   async fn hello(idx: usize) -> Result<Vec<usize>> {
       println!("Hello idx={idx}");
       sleep(Duration::from_secs(1)).await;
       Ok((idx..idx + 3).collect())
   }
   
   #[tokio::main]
   async fn main() {
       let value: HashSet<usize> = vec![1usize, 2, 3].into_iter().collect();
   
       //let data = futures::stream::iter(1..5)
       let data = futures::stream::iter(value)
           .map(|i| async move {
               let data = hello(i).await?;
               Ok::<_, Error>(data)
           })
           .buffer_unordered(10) // .buffered(10)
           .try_for_each(|c| async move {
               println!("{:?}", c);
               Ok(())
           })
           .await;
       println!("{:?}", data);
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to