@@ -19,9 +19,11 @@ First, let's add a shutdown channel to the `client`:
19
19
20
20
``` rust,edition2018
21
21
# extern crate async_std;
22
- # extern crate futures;
22
+ # extern crate futures_channel;
23
+ # extern crate futures_util;
23
24
# use async_std::net::TcpStream;
24
- # use futures::{channel::mpsc, SinkExt};
25
+ # use futures_channel::mpsc;
26
+ # use futures_util::SinkExt;
25
27
# use std::sync::Arc;
26
28
#
27
29
# type Result<T> = std::result::Result<T, Box<dyn std::error::Error + Send + Sync>>;
@@ -68,9 +70,11 @@ We use the `select` macro for this purpose:
68
70
69
71
``` rust,edition2018
70
72
# extern crate async_std;
71
- # extern crate futures;
73
+ # extern crate futures_channel;
74
+ # extern crate futures_util;
72
75
# use async_std::{io::Write, net::TcpStream};
73
- use futures::{channel::mpsc, select, FutureExt, StreamExt};
76
+ use futures_channel::mpsc;
77
+ use futures_util::{select, FutureExt, StreamExt};
74
78
# use std::sync::Arc;
75
79
76
80
# type Receiver<T> = mpsc::UnboundedReceiver<T>;
@@ -118,15 +122,18 @@ The final code looks like this:
118
122
119
123
``` rust,edition2018
120
124
# extern crate async_std;
121
- # extern crate futures;
125
+ # extern crate futures_channel;
126
+ # extern crate futures_util;
122
127
use async_std::{
123
128
io::{BufReader, BufRead, Write},
124
129
net::{TcpListener, TcpStream, ToSocketAddrs},
125
130
task,
126
131
};
127
- use futures::{channel::mpsc, future::Future, select, FutureExt, SinkExt, StreamExt};
132
+ use futures_channel::mpsc;
133
+ use futures_util::{select, FutureExt, SinkExt, StreamExt};
128
134
use std::{
129
135
collections::hash_map::{Entry, HashMap},
136
+ future::Future,
130
137
sync::Arc,
131
138
};
132
139
0 commit comments