We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6d6328a commit 34802caCopy full SHA for 34802ca
docs/src/tutorial/all_together.md
@@ -125,6 +125,18 @@ async fn broker(mut events: Receiver<Event>) -> Result<()> {
125
}
126
Ok(())
127
128
+
129
+fn spawn_and_log_error<F>(fut: F) -> task::JoinHandle<()>
130
+where
131
+ F: Future<Output = Result<()>> + Send + 'static,
132
+{
133
+ task::spawn(async move {
134
+ if let Err(e) = fut.await {
135
+ eprintln!("{}", e)
136
+ }
137
+ })
138
+}
139
140
```
141
142
1. Inside the `server`, we create the broker's channel and `task`.
0 commit comments