abonander / buf_redux

A drop-in replacement for Rust's std::io::BufReader, with extra features
Apache License 2.0
38 stars 16 forks source link

Pause of reading #20

Open DmitryAstafyev opened 2 years ago

DmitryAstafyev commented 2 years ago

These changes make it possible to pause/resume reading. It could be useful in case when we are passing a buffer reader forward and are losing control of it, but still, leave the possibility to pause of reading. For example, we have to read huge file and search inside of it. For search, we are using some kind of search and we are passing an instance of a reader into it. Well from that moment we can stop searching only if the searcher supports such kind of functionality, but if it doesn't - we cannot stop searching anyhow. With present changes, we can do it, even if we don't have direct access to the instance of reader.

DmitryAstafyev commented 2 years ago

@abonander @dignifiedquire @xfix Hello, guys. Do you have some time to take a look at this suggestion?