Skip to content
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

Async RandomAccessReader and zips within zips #100

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

brucehappy
Copy link

Add support for an asynchronous RandomAccessReader, and using that support create a reader implementation for stored entries within a zip file, thereby supporting stored zips within zips. Add a test for the new classes based on the existing range-test.

Related to #89

…pport create a reader implementation for stored entries within a zip file, thereby supporting stored zips within zips. Add a test for the new classes based on the existing range-test.

Related to thejoshwolfe#89
Copy link
Owner

@thejoshwolfe thejoshwolfe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR! unfortunately, I'm extremely picky when it comes to this codebase, and I am inclined to implement this in a different way. I'm not going to have time to do it tonight, but I will try to get to it before the holidays and the new year.

index.js Outdated Show resolved Hide resolved

exports.runTest = runTest;

// zipfile obtained via:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for being conscientious enough to add tests 👍 . However, I think we can test this functionality in a much simpler way.

Copy link
Author

@brucehappy brucehappy Dec 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. I wanted to be certain that ranges within what is basically another range (the zip in the zip) worked properly.

… non-async createReadStream/readStreamCallback calls, but not after running an async createReadStream call. Instead, wait for that call's callback has executed readStreamCallback before unref'ing.
@brucehappy
Copy link
Author

My main goal was backwards compatibility with existing code and RandomAccessReader implementations while adding support for accessing a stored zip within a zip without having to read the whole thing into a buffer or temp file. Looking forward to seeing your approach to solving the problem.

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