mirror of
https://github.com/mainmatter/100-exercises-to-learn-rust
synced 2024-12-25 21:58:26 +01:00
commit
97d13e5c85
2 changed files with 2 additions and 2 deletions
|
@ -41,7 +41,7 @@ across threads.
|
||||||
## Implications
|
## Implications
|
||||||
|
|
||||||
`tokio::spawn` is flavor-agnostic: it'll work no matter if you're running on the multithreaded
|
`tokio::spawn` is flavor-agnostic: it'll work no matter if you're running on the multithreaded
|
||||||
or current-thread runtime. The downside is that the signature assume the worst case
|
or current-thread runtime. The downside is that the signature assumes the worst case
|
||||||
(i.e. multithreaded) and is constrained accordingly:
|
(i.e. multithreaded) and is constrained accordingly:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// TODO: Implement the `fixed_reply` function. It should accept two `TcpListener` instances,
|
// TODO: Implement the `fixed_reply` function. It should accept two `TcpListener` instances,
|
||||||
// accept connections on both of them concurrently, and always reply clients by sending
|
// accept connections on both of them concurrently, and always reply to clients by sending
|
||||||
// the `Display` representation of the `reply` argument as a response.
|
// the `Display` representation of the `reply` argument as a response.
|
||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
use tokio::io::AsyncWriteExt;
|
use tokio::io::AsyncWriteExt;
|
||||||
|
|
Loading…
Reference in a new issue