-
Notifications
You must be signed in to change notification settings - Fork 88
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
add status quo story: first steps into async #56
add status quo story: first steps into async #56
Conversation
372a0c8
to
9b0b2e7
Compare
|
||
### Woes of a newcomer to async | ||
Being reasonably confident in their choice of ecosystem, Frederik starts building their distributed system. | ||
After a while, they want to introduce another networking library of which the api isn't async. Luckily Frederik picked up on that blocking was not allowed in async (or at least not in Tokio), through reading some blog posts about async. More reddit discussions point them towards spawn\_blocking in Tokio, and even rayon. But they're none the wiser about how to apply these paradigms in a neat manner. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only skimmed this, but the point about "at least not in Tokio" makes me a bit sad, because there's so much stuff written about async-std trying to implement a solution that allows blocking, but they never ended up doing it, and now everyone still thinks they allow it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mention that not because I'm under the impression that they allow it, but because I know it might some day be possible. It might well never happen, but I didn't want to state it as a certainty since I'm not educated enough to ascertain that blocking in async will forever be impossible.
I mention that specific blog post later in my sources.
Also, your blog post about blocking (also in my sources) has helped a lot so far! Thanks a lot for writing it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the wording to or at least not in any of the currently existing executors
to avoid confusion :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this spirit of stories being personal experience and thus they cannot be wrong only misinformed, it might be interesting to throw this into a story about mixing blocking into the async world. I, however, have already suggested we separate the blocking vs non-blocking aspects of this story into a separate story so I wouldn't add that to this story per say.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't really intend for this story to be about blocking, but more about the uncertainty that starting in async brings with it. Both surrounding ecosystem choices, but also surrounding design patterns. Design patterns for inclusion of sync code is just one particular example here. This story is really about the need for an authoritative path for newcomers, which provides them with a solid foundation to explore the ecosystem with, and less about any specific technical problems surrounding blocking.
Blocking & ecosystem documentation might be very separate issues with very different solutions, but for me, in this story, they all felt like contributors to the larger cloud of uncertainty.
But I suppose that a very nice technical solution and/or guides on how to handle blocking in async would have made my experience a lot better. Perhaps once I get a better overview on how to deal with blocking in async, I could write a second story about it, and what would have made the experience better. If I were to write a story now, it would be a bit short and touch on a lot of the same things as described here anyways.
9b0b2e7
to
8359a15
Compare
8359a15
to
ebaf23b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really great 🎉. I've added some comments on how we might tidy the story up a tiny bit as well as my suggestion that Barbara is indeed the right character for this story.
src/vision/status_quo/frederik_makes_their_first_steps_into_async.md
Outdated
Show resolved
Hide resolved
src/vision/status_quo/frederik_makes_their_first_steps_into_async.md
Outdated
Show resolved
Hide resolved
|
||
### Woes of a newcomer to async | ||
Being reasonably confident in their choice of ecosystem, Frederik starts building their distributed system. | ||
After a while, they want to introduce another networking library of which the api isn't async. Luckily Frederik picked up on that blocking was not allowed in async (or at least not in any of the currently existing executors), through reading some blog posts about async. More reddit discussions point them towards spawn\_blocking in Tokio, and even rayon. But they're none the wiser about how to apply these paradigms in a neat manner. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's worth noting that this knowledge came through blog posts and not through documentation or any sort of hint from the compiler.
src/vision/status_quo/frederik_makes_their_first_steps_into_async.md
Outdated
Show resolved
Hide resolved
|
||
Their paranoia about choosing the right ecosystem is eased after a few days of research, and some more conversations on the Rust subreddit, after which they discover that most of the RPC libraries they might want to use are situated within the most popular Tokio ecosystem anyways. Tokio also has a brief tutorial, which teaches them some basic concepts within Tokio and talks a bit more about async in general. | ||
|
||
### Woes of a newcomer to async |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like there are two large questions posed by this story, and I'm wondering if they should be broken up into two stories:
- Getting started means almost immediately reckoning with the choice of runtime.
- How to mix blocking and non-blocking apis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its ok to merge as is, there could and should be more stories focusing on the blocking/non-blocking mix in particular, it doesn't feel like the primary focus here
src/vision/status_quo/frederik_makes_their_first_steps_into_async.md
Outdated
Show resolved
Hide resolved
src/vision/status_quo/frederik_makes_their_first_steps_into_async.md
Outdated
Show resolved
Hide resolved
src/vision/status_quo/frederik_makes_their_first_steps_into_async.md
Outdated
Show resolved
Hide resolved
src/vision/status_quo/frederik_makes_their_first_steps_into_async.md
Outdated
Show resolved
Hide resolved
e5370bc
to
efa82dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
I noticed that this is quite close to the issue #46 although I did choose a modified version of barbara since I had experience with Rust, but not with Async. A lot of #54 also shows up in this story. If there was a more convenient, or better explained way to integrate sync code into my project, I would have had less problems I think. Even though I'm trying to make a performant database, it's still for a thesis, and not supposed to be a production system. Being able to rapidly prototype with sync code in my async project would have helped a lot. In hindsight, I also feel a good bit of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was really helpful! Thanks. I really enjoyed reading it, and I thought it was really interesting that you used Barbara here. You identified exactly the reasons in the FAQ, it was fascinating to see how being active in the rust community influenced your sources of information.
Assigning to self to merge after async-foundations triage meeting. |
Hi! This is my experience as a newcomer to async in Rust. Niko might recognize some of these sentiments from me replying to his tweet asking for stories similar to this one surrounding async.
I haven't picked a character yet, as I feel like the character would have a very different experience depending on whether or not they've had previous experience with async in other languages. If I can assume that it not being mentioned means they don't have any experience with it, Alan would probably a decent choice. For now I've used my own name but I will replace it.
I took a very story like approach to writing this, I hope it's not too verbose.
Rendered