-
Notifications
You must be signed in to change notification settings - Fork 983
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feature request: full async/await pattern stream support #223
Comments
So, I had a little bit of a look at this (partly as it's requested, partly out of thinking it might be interesting to tinker with). I initially wondered if it would be possible to start at the bottom of the stream and add it a bit at a time, but the way the zip/gzip streams are imple,ented as subclasses of the deflator streams rather than as containers causes issues with that (if you only implement the async methds of the base class, async calls on the subclasses go through to those and miss the archive specific pieces). However, as a starter - I adapted a few on the unit tests to use async stream calls as a test, and those changes could be made independantly of library changes (as it stands and async calls will be forwarded to the sync versions by the base stream class, but it async methods were to be implemented later that would mean there was already a test base for them). @piksel and comments and/or objections to the idea of adding some async tests to the existing zip test suite? (would just be variants of the existing tests but with async stream calls to start with) |
No, I guess that would be fine. |
This is a very rough first pass at adding async support to ZipOutputStream. All method doing synchronous stream writes have been duplicated with an asynchronous counterpart, starting from `ZipOutputStream.PutNextEntryAsync()`. Unfortunately, this makes a lot of duplicated code but is unavoidable to have both sync + async code paths. .NET Standard 2.1 has been added to the target frameworks. It's required to get full async support with `Stream.DisposeAsync()`. New unit tests must be written to cover the new async code paths. Fixes icsharpcode#223
Running into the same issue as reported in a similar library
|
It's being worked on a bit at a time, but there's quite a bit of work to change everywhere. |
Do we want to close this, or leave it in case of adding async support to the other stream classes (Bzip2 etc) ? |
They should probably be their own issues, although much of the work done in #574 can be used to implement them in the other streams as well. |
Expected behavior
I could not find any related topics, except an unanswered issue "CopyToAsync fails with ZipOutputStream #167".
One of c#'s greatest features over other languages is the async/await pattern. The .net streams all support async/await since ver 4.5 and there could be major implications and performance enhancers for FileStream in particular. Is there any plan to implement this support in this library?
The text was updated successfully, but these errors were encountered: