Skip to content

Add async I/O support for SevenZip archive initialization#1133

Merged
adamhathcock merged 5 commits intoadam/async-creationfrom
copilot/sub-pr-1132
Jan 16, 2026
Merged

Add async I/O support for SevenZip archive initialization#1133
adamhathcock merged 5 commits intoadam/async-creationfrom
copilot/sub-pr-1132

Conversation

Copy link
Contributor

Copilot AI commented Jan 15, 2026

SevenZipArchive was performing synchronous reads during archive initialization, causing failures when used with async-only streams via OpenAsyncArchive.

Changes:

  • ArchiveReader: Added OpenAsync and ReadDatabaseAsync methods that use ReadExactAsync instead of synchronous Read calls
  • SevenZipArchive:
    • Added LoadFactoryAsync to initialize archive database asynchronously
    • Overrode LoadEntriesAsync to use async loading path
    • Converted LoadEntries to iterator pattern (yield return) for proper lazy evaluation

The async and sync code paths are now properly separated, with EntriesAsync using fully async I/O operations:

// Async path now works with async-only streams
await using var archive = await ArchiveFactory.OpenAsyncArchive(asyncOnlyStream);
await foreach (var entry in archive.EntriesAsync)
{
    await using var stream = await entry.OpenEntryStreamAsync();
    // Extract asynchronously
}

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 15, 2026 16:53
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
…adDatabase methods

Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor async creation for multiple archive formats Add async I/O support for SevenZip archive initialization Jan 15, 2026
Copilot AI requested a review from adamhathcock January 15, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants