sstadick / gzp

Multi-threaded Compression
The Unlicense
154 stars 14 forks source link

Support parallel compression of non-static writers #56

Open tofay opened 2 months ago

tofay commented 2 months ago

I'm trying to use this crate with https://github.com/containers/ocidir-rs to create compressed container image layers, however the writer I need to wrap borrows data so doesn't satisfy the lifetime requirements of from_writer.

Would you be open to ParCompress allowing non-static writers by optionally accepting a scope on which the writer thread is spawned? I pushed an example to https://github.com/sstadick/gzp/pull/55.