mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-10-31 00:40:50 +08:00
The timeout for a `UnixStream` will interrupt a `read` even when more data is available. The preference would be that the timeout applies to each read, where the timeout is reset again once a read is successful. This better supports streaming semantics expected for the `Handle::subscribe` method. To achieve this, the `LineIter` type holds the `UnixStream` and timeout `Duration`. The `Iterator` implementation can then use `read_line` to progress the stream one line at a time, and the timeout only applies to each read. Co-authored-by: Alexis Sellier <alexis@radicle.xyz> Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett