-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit futures
dependency to Stream
via feature flag
#1774
Changes from all commits
cd0e973
8cef1fa
19006c3
fb7f606
4ae6d4b
b419acc
9671b4c
b6791cd
97371c6
39ea191
0d80e87
53278d5
ab2bbcd
ac047a2
5b962cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,7 +122,7 @@ impl Handle { | |
/// The next operation in the mock's script will be to expect a `read` call | ||
/// and return `buf`. | ||
pub fn read(&mut self, buf: &[u8]) -> &mut Self { | ||
self.tx.try_send(Action::Read(buf.into())).unwrap(); | ||
self.tx.send(Action::Read(buf.into())).unwrap(); | ||
self | ||
} | ||
|
||
|
@@ -131,7 +131,7 @@ impl Handle { | |
/// The next operation in the mock's script will be to expect a `write` | ||
/// call. | ||
pub fn write(&mut self, buf: &[u8]) -> &mut Self { | ||
self.tx.try_send(Action::Write(buf.into())).unwrap(); | ||
self.tx.send(Action::Write(buf.into())).unwrap(); | ||
self | ||
} | ||
} | ||
|
@@ -298,7 +298,7 @@ impl AsyncRead for Mock { | |
Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => { | ||
if let Some(rem) = self.inner.remaining_wait() { | ||
let until = Instant::now() + rem; | ||
self.inner.sleep = Some(time::delay(until)); | ||
self.inner.sleep = Some(time::delay_until(until)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} else { | ||
self.inner.read_wait = Some(cx.waker().clone()); | ||
return Poll::Pending; | ||
|
@@ -340,7 +340,7 @@ impl AsyncWrite for Mock { | |
Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => { | ||
if let Some(rem) = self.inner.remaining_wait() { | ||
let until = Instant::now() + rem; | ||
self.inner.sleep = Some(time::delay(until)); | ||
self.inner.sleep = Some(time::delay_until(until)); | ||
} else { | ||
panic!("unexpected WouldBlock"); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -524,7 +524,7 @@ async fn client_to_server() { | |
drop(env_logger::try_init()); | ||
|
||
// Create a server listening on a port, then figure out what that port is | ||
let srv = t!(TcpListener::bind("127.0.0.1:0").await); | ||
let mut srv = t!(TcpListener::bind("127.0.0.1:0").await); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
let addr = t!(srv.local_addr()); | ||
|
||
let (server_cx, client_cx) = contexts(); | ||
|
@@ -559,7 +559,7 @@ async fn server_to_client() { | |
drop(env_logger::try_init()); | ||
|
||
// Create a server listening on a port, then figure out what that port is | ||
let srv = t!(TcpListener::bind("127.0.0.1:0").await); | ||
let mut srv = t!(TcpListener::bind("127.0.0.1:0").await); | ||
let addr = t!(srv.local_addr()); | ||
|
||
let (server_cx, client_cx) = contexts(); | ||
|
@@ -590,7 +590,7 @@ async fn one_byte_at_a_time() { | |
const AMT: usize = 1024; | ||
drop(env_logger::try_init()); | ||
|
||
let srv = t!(TcpListener::bind("127.0.0.1:0").await); | ||
let mut srv = t!(TcpListener::bind("127.0.0.1:0").await); | ||
let addr = t!(srv.local_addr()); | ||
|
||
let (server_cx, client_cx) = contexts(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ default = [ | |
"process", | ||
"rt-full", | ||
"signal", | ||
"stream", | ||
"sync", | ||
"time", | ||
] | ||
|
@@ -40,7 +41,7 @@ blocking = ["rt-core"] | |
dns = ["blocking"] | ||
fs = ["blocking"] | ||
io-driver = ["mio", "lazy_static", "sync"] # TODO: get rid of sync | ||
io-util = ["pin-project", "memchr"] | ||
io-util = ["pin-project", "pin-project-lite", "memchr"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trying out |
||
macros = ["tokio-macros"] | ||
net = ["dns", "tcp", "udp", "uds"] | ||
process = [ | ||
|
@@ -55,6 +56,7 @@ process = [ | |
] | ||
# Includes basic task execution capabilities | ||
rt-core = [] | ||
# TODO: rename this -> `rt-threaded` | ||
rt-full = [ | ||
"macros", | ||
"num_cpus", | ||
|
@@ -72,6 +74,7 @@ signal = [ | |
"winapi/consoleapi", | ||
"winapi/minwindef", | ||
] | ||
stream = ["futures-core"] | ||
sync = ["fnv"] | ||
test-util = [] | ||
tcp = ["io-driver"] | ||
|
@@ -84,18 +87,17 @@ uds = ["io-driver", "mio-uds", "libc"] | |
tokio-macros = { version = "=0.2.0-alpha.6", optional = true, path = "../tokio-macros" } | ||
|
||
bytes = "0.4" | ||
futures-core = "0.3.0" | ||
futures-sink = "0.3.0" | ||
futures-util = { version = "0.3.0", features = ["sink", "channel"] } | ||
iovec = "0.1" | ||
|
||
# Everything else is optional... | ||
fnv = { version = "1.0.6", optional = true } | ||
futures-core = { version = "0.3.0", optional = true } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only the |
||
lazy_static = { version = "1.0.2", optional = true } | ||
memchr = { version = "2.2", optional = true } | ||
mio = { version = "0.6.14", optional = true } | ||
num_cpus = { version = "1.8.0", optional = true } | ||
pin-project = { version = "0.4", optional = true } | ||
pin-project-lite = { version = "0.1", optional = true } | ||
# Backs `DelayQueue` | ||
slab = { version = "0.4.1", optional = true } | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unbounded mpsc send API changed to be more ergonomic.