Skip to content

Commit 24861ba

Browse files
Reworded a sentence
1 parent 0f396af commit 24861ba

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/06_multiple_futures/04_spawning.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
Spawning allows you to run a new asynchronous task in the background. This allows us to continue executing other code
44
while it is running.
55

6-
Say we have a webserver that wants to accept connections without blocking the main thread.
7-
We can do this by using the `async_std::task::spawn` function to spawn a new task that runs
8-
the connection handler. This function takes a future and returns a `JoinHandle` that can be
9-
used to await the result of the spawned task.
6+
Say we have a web server that wants to accept connections without blocking the main thread.
7+
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
9+
task once it's completed.
1010

1111
```rust,edition2018
1212
{{#include ../../examples/06_04_spawning/src/lib.rs:example}}

0 commit comments

Comments
 (0)