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

Depend on SharpZipLib #476

Open
adamhathcock opened this issue Sep 7, 2019 · 12 comments
Open

Depend on SharpZipLib #476

adamhathcock opened this issue Sep 7, 2019 · 12 comments

Comments

@adamhathcock
Copy link
Owner

Thinking of using https://github.com/icsharpcode/SharpZipLib Instead of directly using implementations of my own (or forked earlier). SharpZipLib used to be LGPL so I never looked at it. Now it’s MIT.

This project was never about implementing the algorithms or even the archive formats but having an easy and unified interface while allowing forward-only access.

Probably relates to #470

@adamhathcock
Copy link
Owner Author

Probably cannot directly use nuget packages as not much is useful. Probably some code porting is required

@Svetomechc
Copy link

@adamhathcock
Copy link
Owner Author

Because I need access to a lot of the internals of archive formats and they don’t expose them. Otherwise, I’d love to.

@turbolocust
Copy link
Contributor

Offering interruptible async API's would then be more difficult, because you would loose control over portions of the code. SharpZipLib does not support them yet: icsharpcode/SharpZipLib#223

@adamhathcock
Copy link
Owner Author

I need to put some brain power to what the proper way is to implement async for streams. Often I see that there’s nothing really to do?

@turbolocust
Copy link
Contributor

A task has to be returned, that's basically all there is to do (see this link). If the operation should be cancelable, then a CancellationToken should be supported by the API. Streams in .NET usually support this. But if instantaneous cancellation is required, the algorithm that does the archiving logic should support this as well. Also, according to the link in my previous post, SharpZipLib does not support async methods in their stream classes, which is why I wouldn't consider using their library as long as this feature is missing.

@adamhathcock
Copy link
Owner Author

I meant more like if I use the async methods is that good enough? Would sync reuse the async code paths okay?

Not sure at the moment.

@Svetomechc
Copy link

@adamhathcock you mean sync methods actually calling async ones with .GetAwaiter().GetResult()?

@adamhathcock
Copy link
Owner Author

Like if I only implement the async part of Streams, does it use that path if someone uses the sync part?

I don’t want to have people use GetAwaiter().Result() or Wait() which ties up an extra thread.

@Svetomechc
Copy link

@adamhathcock that is a really good question.

@Bluscream
Copy link

that is a really good question.

which noone was ever able to answer :D

@adamhathcock
Copy link
Owner Author

nope

I'd probably just make everything async and let the Stream overloads (or provide them myself)

async has been around long enough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants