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

Generalize chunks/ready_chunks/try_chunks/etc to collect into T: Extend, not just Vec #2492

Open
khuey opened this issue Aug 30, 2021 · 4 comments · May be fixed by #2498
Open

Generalize chunks/ready_chunks/try_chunks/etc to collect into T: Extend, not just Vec #2492

khuey opened this issue Aug 30, 2021 · 4 comments · May be fixed by #2498
Labels
A-stream Area: futures::stream C-feature-request

Comments

@khuey
Copy link
Contributor

khuey commented Aug 30, 2021

In particular I would find it really useful to be able to ready_chunks a Stream of Futures into FuturesOrdereds and spawn them on a threadpool to parallelize my computation.

This would be a breaking change of course.

@taiki-e
Copy link
Member

taiki-e commented Aug 31, 2021

Seems reasonable to me.

@taiki-e taiki-e added this to the futures-0.4, futures-core-1.0 milestone Aug 31, 2021
@taiki-e taiki-e added A-stream Area: futures::stream C-feature-request labels Aug 31, 2021
@khuey
Copy link
Contributor Author

khuey commented Sep 4, 2021

This is actually a bit harder than I thought. Ideally there would be traits for with_capacity and len too so that we can reserve space in the collection and not have to track the collection's size again ourselves in Chunks.

@ibraheemdev
Copy link
Member

There is extend_reserve on nightly.

@khuey
Copy link
Contributor Author

khuey commented Sep 4, 2021

Yeah people don't seem eager to stabilize it though, and there's nothing at all for len.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-stream Area: futures::stream C-feature-request
Projects
None yet
3 participants