mirror of
https://github.com/fafhrd91/actix-net
synced 2024-11-24 00:01:11 +01:00
better naming
This commit is contained in:
parent
cedba24a36
commit
132be0baa1
@ -47,7 +47,7 @@ where
|
|||||||
type Future = FromErrFuture<A, E, Request>;
|
type Future = FromErrFuture<A, E, Request>;
|
||||||
|
|
||||||
fn poll_ready(&mut self) -> Poll<(), E> {
|
fn poll_ready(&mut self) -> Poll<(), E> {
|
||||||
Ok(self.service.poll_ready().map_err(E::from)?)
|
self.service.poll_ready().map_err(E::from)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn call(&mut self, req: Request) -> Self::Future {
|
fn call(&mut self, req: Request) -> Self::Future {
|
||||||
|
@ -210,7 +210,7 @@ where
|
|||||||
<U as Encoder>::Item: 'static,
|
<U as Encoder>::Item: 'static,
|
||||||
<U as Encoder>::Error: std::fmt::Debug,
|
<U as Encoder>::Error: std::fmt::Debug,
|
||||||
{
|
{
|
||||||
fn poll_service(&mut self) -> bool {
|
fn poll_read(&mut self) -> bool {
|
||||||
loop {
|
loop {
|
||||||
match self.service.poll_ready() {
|
match self.service.poll_ready() {
|
||||||
Ok(Async::Ready(_)) => loop {
|
Ok(Async::Ready(_)) => loop {
|
||||||
@ -246,8 +246,8 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// write to sink
|
/// write to framed object
|
||||||
fn poll_response(&mut self) -> bool {
|
fn poll_write(&mut self) -> bool {
|
||||||
let inner = self.inner.get_mut();
|
let inner = self.inner.get_mut();
|
||||||
loop {
|
loop {
|
||||||
while !self.framed.is_write_buf_full() {
|
while !self.framed.is_write_buf_full() {
|
||||||
@ -354,7 +354,7 @@ where
|
|||||||
fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
|
fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
|
||||||
match mem::replace(&mut self.state, TransportState::Processing) {
|
match mem::replace(&mut self.state, TransportState::Processing) {
|
||||||
TransportState::Processing => {
|
TransportState::Processing => {
|
||||||
if self.poll_service() || self.poll_response() {
|
if self.poll_read() || self.poll_write() {
|
||||||
self.poll()
|
self.poll()
|
||||||
} else {
|
} else {
|
||||||
Ok(Async::NotReady)
|
Ok(Async::NotReady)
|
||||||
@ -362,7 +362,7 @@ where
|
|||||||
}
|
}
|
||||||
TransportState::Error(err) => {
|
TransportState::Error(err) => {
|
||||||
if self.framed.is_write_buf_empty()
|
if self.framed.is_write_buf_empty()
|
||||||
|| (self.poll_response() || self.framed.is_write_buf_empty())
|
|| (self.poll_write() || self.framed.is_write_buf_empty())
|
||||||
{
|
{
|
||||||
Err(err)
|
Err(err)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user