client: stream.poll_complete() for ease of use
This commit is contained in:
parent
a92e7a0ff7
commit
58b5a84391
4 changed files with 24 additions and 20 deletions
|
|
@ -92,6 +92,15 @@ impl Stream for Component {
|
|||
}
|
||||
},
|
||||
ComponentState::Connected(mut stream) => {
|
||||
// Poll sink
|
||||
match stream.poll_complete() {
|
||||
Ok(Async::NotReady) => (),
|
||||
Ok(Async::Ready(())) => (),
|
||||
Err(e) =>
|
||||
return Err(e.description().to_owned()),
|
||||
};
|
||||
|
||||
// Poll stream
|
||||
match stream.poll() {
|
||||
Ok(Async::NotReady) => {
|
||||
self.state = ComponentState::Connected(stream);
|
||||
|
|
|
|||
Loading…
Reference in a new issue