Tokio-fs, Stdin and poll


#1

So I have this code:

http://play.rust-lang.org/?gist=2a9d321327540cef03d3eb9ecb54480e

It polls stdin and only yields item if there were more than 5 bytes.

If I return Ok(NotReady) from my poll method everything stops working.
My stream’s poll will not be called anymore.

What am I missing?


#2

I think you need to somehow schedule your future to be woken up once more data is available. But I don’t know how that is done in the tokio_fs API.


#3

You have to loop until poll_read() returns NotReady; when it does, it’ll register itself for a notification when it has more data to read.


#4

Yes, loop fixed it. Thanks!