You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-07-05 22:19:01 +02:00
Speaker notes for unbounded channels
This commit is contained in:
@ -30,4 +30,17 @@ fn main() {
|
||||
}
|
||||
```
|
||||
|
||||
<details>
|
||||
|
||||
- The channel is called asynchronous because there is no synchronization between
|
||||
sending and receiving.
|
||||
- The channel buffers the values. The buffer grows automatically, similar to how
|
||||
a `Vec` grows when you push data to it.
|
||||
- The channel takes ownership of the values when you call [`send()`]. This is
|
||||
seen in the signature: it takes `T` by value. You thus lose access to the
|
||||
value you send into a channel.
|
||||
|
||||
</details>
|
||||
|
||||
[`mpsc::channel()`]: https://doc.rust-lang.org/std/sync/mpsc/fn.channel.html
|
||||
[`send()`]: https://doc.rust-lang.org/std/sync/mpsc/struct.Sender.html#method.send
|
||||
|
@ -24,7 +24,7 @@ fn main() {
|
||||
cycles that will get dropped.
|
||||
|
||||
[1]: https://doc.rust-lang.org/std/rc/struct.Rc.html
|
||||
[2]: ../concurrency/shared_state/arc.md
|
||||
[2]: ../concurrency/shared-state/arc.md
|
||||
[3]: https://doc.rust-lang.org/std/sync/struct.Mutex.html
|
||||
[4]: https://doc.rust-lang.org/std/rc/struct.Weak.html
|
||||
|
||||
|
Reference in New Issue
Block a user