Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement try_batch #24

Open
nikis05 opened this issue May 22, 2023 · 3 comments
Open

Implement try_batch #24

nikis05 opened this issue May 22, 2023 · 3 comments

Comments

@nikis05
Copy link

nikis05 commented May 22, 2023

futures::stream::TryStreamExt has a try_chunks method that batches Ok values and immediately propagates any Err values. I believe it would be very useful to have something like that in this library.

@mre
Copy link
Owner

mre commented May 22, 2023

Indeed. Would you like to give this a try?

@mre
Copy link
Owner

mre commented May 22, 2023

For some guidance, you'd have to copy the code from https://github.com/rust-lang/futures-rs/blob/master/futures-util/src/stream/try_stream/try_chunks.rs and add the timeout as we do for the normal ChunksTimeout.
Maybe create a separate module for it, so at the end we have

  • lib.rs (just imports chunks and try_cunks)
  • chunks.rs (the current code in lib.rs)
  • try_chunks.rs (the new code)

Ideally, add some tests as well. 😃

@nikis05
Copy link
Author

nikis05 commented May 22, 2023

@mre sounds good, I’ll give it a try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants