rayonzip
A library for creating zip files using rayon for thread control
This library is inspired by mtzip, which manages concurrency by itself.
After some tests, it's even slower than single-threaded program that uses zip library. All tested on rfmp.
Example usage:
use ThreadPoolBuilder;
use ZipArchive;
# Get amount of available threads for use
let threads = available_parallelism.unwrap;
# Build a rayon thread pool
let thread_pool = new.num_thread.build.unwrap;
# Create a zp archive that'll use the thread pool to compress concurrently
let mut zipper = new;
# Add a file from filesystem
zipper.add_file_from_fs;
# Add a file from binary slice
zipper.add_file_from_slice;
# Adding a directory and a file to it
zipper.add_directory;
zipper.add_file;
# Writing to a file
# First, open/create a file
let mut file = create.unwrap;
# Now, write the zip archive data to a file
zipper.write.unwrap;