We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
tokio 0.1.8 futures 0.1.21
Linux sdzx 4.18.5-arch1-1-ARCH #1 SMP PREEMPT Fri Aug 24 12:48:58 UTC 2018 x86_64 GNU/Linux
poll_read on tokio::io::Stdin is blocking. that is unexpected and confusing.
extern crate tokio; #[macro_use] extern crate futures; use tokio::io::{AsyncRead,stdin}; use std::io::{Write, stdout}; use futures::{Future, Async}; struct IoBridge<R,W> where R: AsyncRead, W: Write, { r: R, w: W, } impl<R,W> Future for IoBridge<R,W> where R: AsyncRead, W: Write, { type Item = (); type Error = tokio::io::Error; fn poll(&mut self) -> Result<Async<Self::Item>, Self::Error> { println!("."); let mut buf = [0;1024]; loop { let len = try_ready!(self.r.poll_read(&mut buf)); println!("<< {}", len); if len == 0 { return Ok(Async::Ready(())); } self.w.write(&buf[..len])?; self.w.flush()?; } } } fn main() { let f = IoBridge{ r: stdin(), w: stdout() }.map_err(|e|panic!(e)); tokio::run(f); }
note that . is only printed once. the loop will never exit.
The text was updated successfully, but these errors were encountered:
Thanks for the report. Dup of #589.
Sorry, something went wrong.
No branches or pull requests
Version
tokio 0.1.8
futures 0.1.21
Platform
Linux sdzx 4.18.5-arch1-1-ARCH #1 SMP PREEMPT Fri Aug 24 12:48:58 UTC 2018 x86_64 GNU/Linux
Description
poll_read on tokio::io::Stdin is blocking. that is unexpected and confusing.
note that . is only printed once. the loop will never exit.
The text was updated successfully, but these errors were encountered: