Skip to content

Commit

Permalink
Add link to mpsc in the shutdown docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hackaugusto committed Dec 11, 2023
1 parent 5de5032 commit 4af0857
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions content/tokio/topics/shutdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ async fn main() {
// send shutdown signal to application and wait
}
```
If you have multiple shutdown conditions, you can use [an mpsc channel] to send
the shutdown signal to one place. You can then [select] on [`ctrl_c`][ctrl_c]
and the channel. For example:
If you have multiple shutdown conditions, you can use [an mpsc channel][mpsc]
to send the shutdown signal to one place. You can then [select] on
[`ctrl_c`][ctrl_c] and the channel. For example:
```rs
use tokio::signal;
use tokio::sync::mpsc;
Expand Down Expand Up @@ -173,3 +173,4 @@ async fn some_operation(i: u64) {
[shutdown.rs]: https://github.com/tokio-rs/mini-redis/blob/master/src/shutdown.rs
[server.rs]: https://github.com/tokio-rs/mini-redis/blob/master/src/server.rs
[mini-redis]: https://github.com/tokio-rs/mini-redis/
[mpsc]: https://docs.rs/tokio/1/tokio/sync/mpsc/index.html

0 comments on commit 4af0857

Please sign in to comment.