-
Notifications
You must be signed in to change notification settings - Fork 499
adds more async tests and overloads to make things writable and async #980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces comprehensive async support for archive operations in SharpCompress, enabling non-blocking save and extraction functionality across GZip, Tar, and Zip archive types. The changes modernize the API to support async/await patterns throughout the library.
Key Changes:
- Added
SaveToAsyncmethods toIWritableArchiveand concrete archive implementations (GZipArchive, TarArchive, ZipArchive) - Introduced
WriteToAsyncandWriteToFileAsyncextension methods forIArchiveEntryto support async extraction - Created comprehensive async unit tests for GZip archives to validate the new async functionality
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/SharpCompress/Archives/IWritableArchive.cs |
Added SaveToAsync method signature to interface |
src/SharpCompress/Archives/IWritableArchiveExtensions.cs |
Added async extension methods for saving archives to files and streams |
src/SharpCompress/Archives/AbstractWritableArchive.cs |
Implemented base SaveToAsync method and added abstract method for derived classes |
src/SharpCompress/Archives/GZip/GZipArchive.cs |
Implemented SaveToAsync with GZip-specific logic and file overloads |
src/SharpCompress/Archives/Tar/TarArchive.cs |
Implemented SaveToAsync for Tar archives |
src/SharpCompress/Archives/Zip/ZipArchive.cs |
Implemented SaveToAsync for Zip archives |
src/SharpCompress/Archives/IArchiveEntryExtensions.cs |
Added WriteToAsync and WriteToFileAsync for async entry extraction |
tests/SharpCompress.Test/GZip/GZipArchiveAsyncTests.cs |
Added async test coverage for GZip archive operations |
tests/SharpCompress.Test/GZip/GZipWriterAsyncTests.cs |
Added async test coverage for GZip writer operations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request adds asynchronous support for saving and extracting archives in the SharpCompress library. It introduces new async methods for writing archive entries and saving entire archives, enabling non-blocking I/O operations and cancellation support. The changes span core archive types (Zip, Tar, GZip), extension methods, and add comprehensive async extraction capabilities.
Async archive saving and extraction:
SaveToAsyncmethods toIWritableArchive,AbstractWritableArchive, and their extension classes, allowing archives to be saved asynchronously to streams and files with cancellation support. [1] [2] [3]SaveToAsyncoverrides forZipArchive,TarArchive, andGZipArchiveto asynchronously write archive entries using their respective writers. [1] [2] [3]Async entry extraction:
WriteToAsync,WriteToDirectoryAsync, andWriteToFileAsyncextension methods toIArchiveEntryExtensions, enabling asynchronous extraction of archive entries to streams, directories, or files. [1] [2] [3]Async writer support:
TarWriterwithWriteAsyncmethods for writing entries asynchronously, supporting progress, cancellation, and stream size validation.Testing improvements:
ArchiveTests.csto verify asynchronous archive extraction and ensure correctness of the new async APIs.These changes modernize the library for better scalability and responsiveness in applications that use SharpCompress for large or remote archives.