Intro to async/.await in Rust

preview_player
Показать описание
In today's video I'm diving into the async/.await model in Rust!

#rust #programming #tutorial
Рекомендации по теме
Комментарии
Автор

A sink and a weight are things you find at a gym.

kinositajona
Автор

I straight up will never get over how the guy pronounces "cheet sheet"

julkiewicz
Автор

Can you show us how to make an implementation of what a simple runtime might look like. Otherwise great video

Musikur
Автор

what is the point of having async functions in standard library if they can't by default be executed asynchronously

leokillerable
Автор

tokio = { version = "*", features = ["rt-multi-thread", "macros"] }

to reduce compilation time

stevenhe
Автор

You make the best videos on Rust I've seen. Most others, even on this specific subject, just talk fast and gloss over dozens of things, whereas you explain things as if you actually want me to have a chance at writing this code myself later. Thanks for the quality content!

NieLL
Автор

Just like I always say, Async Rust makes Multi-threading look easy

krtirtho
Автор

I dont understand the await/async is nessesary for this. Using threads/tokyo should add the concurrency. Why was the async and await nessesary.

jakob
Автор

Woah, excellent explanation of the async workflow! I always got confused with the tokio stuff, but you've built it up so nicely that it made perfect sense by the time it came up in the video!

J-Kimble
Автор

The for loop in lines 15-17 (for handle in handles) makes me think you're sequentially calling await. How does it execute concurrently?

Pg
Автор

This was so helpful! I was so confused that async is a rust keyword but then everywhere they tell you need some runtime as a crate, since it is not part of the std. Like what? Very confusing for a beginner, but your video explained this greatly! I would like to see more videos about these kind of interactions, maybe how the microcontroller ecosystem is build with HALs etc if you know more about that :)

Mane
Автор

Aren't we all just awaiting the future....

kiransingh
Автор

These inlay hints of visual studio are always so annoying.

porky
Автор

You say you shoulnt put cpu intensive operations in async code.

lets say have a big list of elements that need to be processed. Is making my function that processes them async and sending slices of the list to it so it runs can run concurrently a bad idea?

affegpus
Автор

A very clear description of the tip of the iceberg. I've finally sat through Jon Gjengset's videos and my head is full to bursting. Keep going, these are great.

mageprometheus
Автор

My nodejs brain was doing fine, until you started getting all concurrent 😂
Great video though, helps a lot!

everyhandletaken
Автор

Thanks! Answers a lot of questions for me at the point where I am now. I'm coming from many years of working with C# (and several other languages, but async await is especially important in C#).
I have started learning Rust and I've alread gone through the entire official Rust book too (which comes with a manually written ThreadPool example with a mini HTTP server), but that doesn't talk about async await yet.
I really like that you can configure the threading behaviour of the tokio library. In C# this behaviour is much more contextual, based on whether you have a so called SynchronizationContext, which is the case in UI frameworks, but not in console applications.
In a UI framework you get single threaded behaviour by default for async code, so that you get less issues with cross thread access on the UI, but the risk on deadlocks is higher if you do things incorrectly.
Though sometimes you want to configure things per method call, in order to overrule that single threaded continuation behaviour. Does Rust or the tokio library also serve an equivalent of ConfigureAwait?

jongeduard
Автор

Whenever I see this "async" polluting codebases, I feel thankful for the simplicity of the "go" keyword.

deNudge
Автор

i watched a lot of videos and have read a lot of tutorials but all of these tell about “how to implement an echo server with tokio”, bot explaining how it works.
your video in a few minutes explains perfectly how it works.

massimommm
Автор

follow-up question - what about the state / future of generators?

Beiri