Repository: hannobraun/inotify-rs (language: rust)

Issue:
EventStream not working
Hello. My apologies - while upgrading to tokio 0.3, I introduced a bug which causes some problems with reading events from an EventStream instance. Only one or two events get read, the rest becomes lost. 

Minimal reproducible example, try this with inotify 0.8.3 and inotify 0.9.0. Move your mouse or type on your keyboard and watch the output of this program. 
```
#[tokio::main]
async fn main() {
    let mut inotify = Inotify::init().unwrap();
    inotify
        .add_watch("/dev/input", WatchMask::ALL_EVENTS)
        .unwrap();

    let mut stream = inotify.event_stream([0; 512]).unwrap();
    while let Some(event) = stream.next().await {
        let event = event.unwrap();
        println!("{:?}", event);
    }
}
```
I suggest that you yank the 0.9.0 release from crates.io until a fix is made. I think it will be something trivial, probably a missing task wake up or something like that.



Discussion / hints:

Fix patch:
diff --git a/src/stream.rs b/src/stream.rs
index 20d40bc..5c5a2c7 100644
--- a/src/stream.rs
+++ b/src/stream.rs
@@ -98,7 +98,10 @@ fn read(fd: &AsyncFd<ArcFdGuard>, buffer: &mut [u8], cx: &mut Context) -> Poll<i
 
     match result {
         Ok(read) => Poll::Ready(Ok(read)),
-        Err(ref err) if err.kind() == io::ErrorKind::WouldBlock => Poll::Pending,
+        Err(ref err) if err.kind() == io::ErrorKind::WouldBlock => {
+            cx.waker().wake_by_ref();
+            Poll::Pending
+        }
         Err(err) => Poll::Ready(Err(err)),
     }
 }


Test patch: