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

Async exercises #2040

Open
mo8it opened this issue Jul 10, 2024 · 7 comments
Open

Async exercises #2040

mo8it opened this issue Jul 10, 2024 · 7 comments
Labels
A-exercises Area: Exercises C-new-exercise Category: New Exercise P-low Priority: Low

Comments

@mo8it
Copy link
Contributor

mo8it commented Jul 10, 2024

The book will got a new chapter about async. We should add some async exercises.

@mo8it mo8it added A-exercises Area: Exercises C-new-exercise Category: New Exercise labels Jul 10, 2024
@mo8it mo8it mentioned this issue Sep 2, 2024
@mo8it mo8it added S-blocked Status: Blocked P-low Priority: Low labels Sep 2, 2024
@Polycarbohydrate
Copy link
Contributor

Polycarbohydrate commented Mar 2, 2025

Any update on this? I would like to see some async exercises as well. :)

@mo8it
Copy link
Contributor Author

mo8it commented Mar 2, 2025

Now that the async chapter is added to the book, I am open to exercise ideas :)

@mo8it mo8it removed the S-blocked Status: Blocked label Mar 2, 2025
@Polycarbohydrate
Copy link
Contributor

Sound good 👍! I'll probably start thinking of ideas and start on async1.

I think we should probably put the async exercise folder after 20_threads (because of the ordering of the book and it just makes sense to do async exercises after learning concurrency) and async would be #21, 21_async. Would need to shift the rest of the exercises' respective numbers as well.

For the exercises, I was thinking at the very least, there would be 4 exercises to cover the lengthy chapter as well as most of the key points covered. In the book, the example code shown uses trpl for many async methods but I feel like using tokio would work better as it is well-known and used. Like the rest of the rustlings exercises, this section should start with some simple concepts of asynchronous programming in Rust and then work toward more advanced features (if wanted).

@mo8it
Copy link
Contributor Author

mo8it commented Mar 5, 2025

Tokio for sure. Rustlings v6 allows adding dependencies to exercises, but this possibility is not used in any exercise yet.

@Polycarbohydrate
Copy link
Contributor

Rustlings v6 allows adding dependencies to exercises

Is there any documentation for this? I tried looking in the changelog and version history but I can't find anything.

@mo8it
Copy link
Contributor Author

mo8it commented Mar 7, 2025

You just add the dependency to the dev/Cargo.toml file.

@Polycarbohydrate
Copy link
Contributor

Created a PR: #2216

Fails the dev check (which I explained in the comment below the PR) and the MacOS check. Feedback is welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-exercises Area: Exercises C-new-exercise Category: New Exercise P-low Priority: Low
Projects
None yet
Development

No branches or pull requests

2 participants