mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-02-18 09:40:22 +02:00
Minor fixes to async notes (#607)
* `join!( .., time::sleep(..))` isn't really a "timeout" * Remove suggestion to make `sleep` take `&mut self` I'm not sure what doing so demonstrates. * Update src/async/control-flow/join.md Co-authored-by: rbehjati <razieh@google.com> --------- Co-authored-by: rbehjati <razieh@google.com>
This commit is contained in:
parent
1288d11adb
commit
cce3fff0d0
@ -43,9 +43,8 @@ Copy this example into your prepared `src/main.rs` and run it from there.
|
||||
cause your program to stall.
|
||||
|
||||
* You can also combine `join_all` with `join!` for instance to join all requests
|
||||
to an http service as well as a database query.
|
||||
|
||||
* Try adding a timeout to the future, using `futures::join!`.
|
||||
to an http service as well as a database query. Try adding a
|
||||
`tokio::time::sleep` to the future, using `futures::join!`. This is not a
|
||||
timeout (that requires `select!`, explained in the next chapter), but demonstrates `join!`.
|
||||
|
||||
</details>
|
||||
|
||||
|
@ -60,6 +60,4 @@ async fn main() {
|
||||
* Try creating a new sleeper struct that will sleep for a random amount of time
|
||||
and adding it to the Vec.
|
||||
|
||||
* Try making the `sleep` call take `&mut self`.
|
||||
|
||||
</details>
|
||||
|
Loading…
x
Reference in New Issue
Block a user