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

Supporting n-ary join #865

Open
rocallahan opened this issue May 24, 2021 · 1 comment
Open

Supporting n-ary join #865

rocallahan opened this issue May 24, 2021 · 1 comment

Comments

@rocallahan
Copy link
Contributor

I want to run N closures in parallel, where each closure returns a value of a different type. join works great for two tasks. I can use join for N tasks by building a tree of binary joins, but that's ugly.

Would it make sense to have a join_all! macro that does an N-ary join, building a linear chain of joins under the hood? Or is there a better way to implement it?

@cuviper
Copy link
Member

cuviper commented May 24, 2021

There's an old PR for that, #406. That included a funky inner-let form that we were a little worried about, but a simple variadic join! that returns a flat tuple seemed like a safe bet.

There are some macros added since in src/iter/multizip.rs that might help with tuple flattening. We probably don't want to export internal utility-level stuff though.

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