rust_book/ch17/async-await.md

17 lines
421 B
Markdown

# Async and Await Notes
```rust
let data = fetch_data_from(url).await;
println!("{data}");
```
## Parallelism and Concurrency
*Concurrency*: When an individual works on several different
tasks before any of them is complete. When get bored with one
project, just switch to another task.
*Parallelism*: Split up a group of tasks between the people on
the team with each person taking one task and working
on it alone.