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

Alan isn't satisfied with the join and select macros #139

Open
1 of 4 tasks
TheRawMeatball opened this issue Apr 10, 2021 · 4 comments
Open
1 of 4 tasks

Alan isn't satisfied with the join and select macros #139

TheRawMeatball opened this issue Apr 10, 2021 · 4 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed status-quo-story-ideas "Status quo" user story ideas

Comments

@TheRawMeatball
Copy link

Brief summary

Alan was working on a endpoint which would be making a large amount of async requests, and decided to do a join operation to await them in parallel. After a bunch of time spent googling, he realized that these operations weren't part of the language or std, but implemented in his runtime. He used the join! macro to poll them in parallel, but was disappointed to see that the tooling he was accustomed to, such as rustfmt or rust-analyzer didn't work nicely with this macro. He fell back to using the join3 method in the futures crate instead, since he didn't need that many types. However, as the endpoint grew, he is currently at the limit and wishes this limit didn't exist.

Optional details

  • (Optional) Which character(s) would be the best fit and why?
    • Alan: the experienced "GC'd language" developer, new to Rust
    • Grace: the systems programming expert, new to Rust
    • Niklaus: new programmer from an unconventional background
    • Barbara: the experienced Rust developer
  • (Optional) Which project(s) would be the best fit and why?
    • Most projects could likely be used to tell this story, since join and select can come up in a lot of diverse scenarios.
  • (Optional) What are the key points or morals to emphasize?
    • Macros are hard to deal with by tooling.
    • Ideally, variadics could be used without resorting to macros, since they are a missing part of the rust type system which can be limiting.
    • Join and select are fundamental future primitives which should be easier to find.
@TheRawMeatball TheRawMeatball added good first issue Good for newcomers help wanted Extra attention is needed status-quo-story-ideas "Status quo" user story ideas labels Apr 10, 2021
@nikomatsakis
Copy link
Contributor

Ah, the rustfmt tie in is really interesting!

@taiki-e
Copy link
Member

taiki-e commented Apr 25, 2021

He used the join! macro to poll them in parallel, but was disappointed to see that the tooling he was accustomed to, such as rustfmt or rust-analyzer didn't work nicely with this macro.

As far as I know, the join macros in futures and tokio are compatible with rustfmt. What kind of code did you run into rustfmt problem with?

@taiki-e
Copy link
Member

taiki-e commented May 15, 2021

The compatibility issue with rust-analyzer has been fixed in futures 0.3.15.

@TheRawMeatball
Copy link
Author

Ah, nice :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed status-quo-story-ideas "Status quo" user story ideas
Projects
None yet
Development

No branches or pull requests

3 participants