popol
popol copied to clipboard
Minimal non-blocking I/O for Rust
Add a new, public `Sources::poll()` method that takes a value of the newly created `Timeout` enum with `Timeout::After(Duration)` and `Timeout::Never` variants. Fix #4 --- I’ve tried to match your style...
Not all sources of streams (e.g. `std::process`) provide an easy way to set the stream into non-blocking mode. This fills the gap. This resolves #5. --- I realized the code...
I suspect a lot of applications that need to poll will also need non-blocking streams. Otherwise, you can end up reading all of one stream before you get any output...
Having separate `wait()` and `wait_timeout()` functions is (mildly) inconvenient in code where the timeout is optional. It would be nice to have a unified function that takes `Option`, for example:...
Running `test_waker_threaded` in Rust 1.70 on macOS almost always either fails or hangs indefinitely. ``` ---- tests::test_waker_threaded stdout ---- thread 'tests::test_waker_threaded' panicked at 'called `Result::unwrap_err()` on an `Ok` value: ()',...
Previously, `test_threaded()` started a thread that made two writes to each pipe. This had the potential for a race condition since the read might occur between the two writes. This...
`test_timeout()` checks that the timeout parameter works by waiting on stdout to be ready for reading with a timeout of 1 ms. One might guess that stdout would never be...
This adds automatic checks for each PR: * `cargo clippy` * `cargo fmt` (checks that `cargo fmt` is a no-op) * [`cargo msrv`](https://github.com/foresterre/cargo-msrv) (verifies that minimum supported Rust version is...
This fixes a few race conditions in `test_waker_threaded()` and adds a timeout to ensure that it doesn’t hang forever if something goes wrong. Some notes: * It is always possible...