1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-02-21 15:14:48 +01:00

Fix back-pressure handling for concurrent connections

This commit is contained in:
Nikolay Kim 2018-12-21 10:43:18 -08:00
parent 298727dcbd
commit ebf8d7fa34
8 changed files with 22 additions and 15 deletions

View File

@ -1,5 +1,12 @@
# Changes
## [0.2.6] - 2018-12-21
### Fixed
* Fix back-pressure handling for concurrent connections
## [0.2.5] - 2018-12-12
### Fixed

View File

@ -1,6 +1,6 @@
[package]
name = "actix-net"
version = "0.2.5"
version = "0.2.6"
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
description = "Actix net - framework for the compisible network services for Rust (experimental)"
readme = "README.md"
@ -58,8 +58,7 @@ tokio-timer = "0.2"
tokio-reactor = "0.1"
tokio-current-thread = "0.1"
tower-service = "0.1"
trust-dns-proto = "^0.5.0"
trust-dns-resolver = "^0.10.0"
trust-dns-resolver = "^0.10.2"
# native-tls
native-tls = { version="0.2", optional = true }

View File

@ -80,7 +80,8 @@ fn main() {
future::ok(())
})
},
).unwrap()
)
.unwrap()
.start();
sys.run();

View File

@ -61,7 +61,8 @@ fn main() {
println!("got ssl connection {:?}", num);
future::ok(())
})
}).unwrap()
})
.unwrap()
.start();
sys.run();

View File

@ -254,7 +254,8 @@ where
io::ErrorKind::WriteZero,
"failed to \
write frame to transport",
).into());
)
.into());
}
// TODO: Add a way to `bytes` to do this w/o returning the drained

View File

@ -9,10 +9,7 @@
#![cfg_attr(
feature = "cargo-clippy",
allow(
declare_interior_mutable_const,
borrow_interior_mutable_const
)
allow(declare_interior_mutable_const, borrow_interior_mutable_const)
)]
#[macro_use]

View File

@ -83,9 +83,9 @@ where
});
if let Ok(stream) = stream {
spawn(self.service.call(stream).map_err(|_| ()).map(move |val| {
spawn(self.service.call(stream).then(move |res| {
drop(guard);
val
res.map_err(|_| ())
}));
ok(())
} else {
@ -123,9 +123,9 @@ where
}
fn call(&mut self, (guard, req): (Option<CounterGuard>, ServerMessage)) -> Self::Future {
spawn(self.service.call(req).map_err(|_| ()).map(move |val| {
spawn(self.service.call(req).then(move |res| {
drop(guard);
val
res.map_err(|_| ())
}));
ok(())
}

View File

@ -167,7 +167,8 @@ impl Worker {
.map_err(|e| {
error!("Can not start worker: {:?}", e);
Arbiter::current().do_send(StopArbiter(0));
}).and_then(move |services| {
})
.and_then(move |services| {
for item in services {
for (idx, token, service) in item {
while token.0 >= wrk.services.len() {