KillingSpark / zstd-rs

zstd-decoder in pure rust
MIT License
258 stars 34 forks source link

Usage with tokio #68

Open kpcyrd opened 2 months ago

kpcyrd commented 2 months ago

hello!

I was wondering, are there any plans for a tokio integration? This would allow passing an AsyncRead object to StreamingDecoder (or an equivalent) and then being able to .await decompressed data.

I think I had a need for that earlier but didn't open an issue back then. :)

The async_compression crate has implemented something like this on top of the zstd/zstd-safe crates, maybe that could be of use:

https://docs.rs/async-compression/0.4.12/async_compression/tokio/bufread/struct.ZstdDecoder.html

Thanks!

KillingSpark commented 2 months ago

There is no async integration yet but it's definitely an interesting topic