Skip to content

Commit 3889ec8

Browse files
JoinHandle now in Codeblock and added note about channels
1 parent d9f4e06 commit 3889ec8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/06_multiple_futures/04_spawning.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ while it is running.
55

66
Say we have a web server that wants to accept connections without blocking the main thread.
77
To achieve this, we can use the `async_std::task::spawn` function to create and run a new task that handles the
8-
connections. This function takes a future and returns a JoinHandle, which can be used to wait for the result of the
8+
connections. This function takes a future and returns a `JoinHandle`, which can be used to wait for the result of the
99
task once it's completed.
1010

1111
```rust,edition2018
1212
{{#include ../../examples/06_04_spawning/src/lib.rs:example}}
13-
```
13+
```
14+
15+
To communicate between the main task and the spawned task, we can use
16+
provided by the used async runtime.

0 commit comments

Comments
 (0)