Add progress callback support to archive and extract pipelines
Introduce progress reporting to the archive packaging and extraction
functions through an optional callback parameter. The ProgressFn type is a
boxed closure receiving an ArchiveStage enum and a fractional progress
value from 0.0 to 1.0. Eight stages cover the full lifecycle: Scanning,
Tarring, Compressing, Encrypting, Hashing, Decrypting, Decompressing, and
Extracting.
The original create_archive and extract_archive signatures are preserved
as convenience wrappers that call the new create_archive_with_progress and
extract_archive_with_progress variants with None for the callback,
maintaining backward compatibility for callers that do not need progress
reporting.
Progress granularity is coarse but meaningful: the archive pipeline
reports six transitions (Scanning at 0.0, Tarring at 0.1, Compressing at
0.3, Encrypting at 0.5, Hashing at 0.9 and 1.0). The extract pipeline
reports eight transitions (Hashing at 0.0 and 0.2, Decrypting at 0.3 and
0.5, Decompressing at 0.6, Extracting at 0.7 and 1.0). Future
refinements could report per-file progress during the tar stage by
tracking bytes written against the pre-computed directory size.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.