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

On ongoing branch of making everything async #565

Draft
wants to merge 33 commits into
base: master
Choose a base branch
from
Draft

Conversation

adamhathcock
Copy link
Owner

@adamhathcock adamhathcock commented Feb 1, 2021

  • Use ReadAsync/WriteAsync on every stream
  • Use CancelationToken (drop Listener interface?)
  • Use ValueToken (need to find better Task.Completed version)
  • Use IAsyncDisposable (drop IDispose as it mostly doesn't apply)
  • Use IAsyncEnumerable
  • Some usage of Memory/Span. Usage of MemoryPool seem good but don't want to completely convert yet.
  • More?

@@ -137,11 +139,11 @@ private bool DoesKeyMatchExisting(string key)
return false;
}

public void SaveTo(Stream stream, WriterOptions options)
public async Task SaveToAsync(Stream stream, WriterOptions options)
Copy link

@JanHyka JanHyka Feb 1, 2021

Choose a reason for hiding this comment

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

CancellationToken parameter should be passed through whole call chain and exposed to library consumers (as non-mandatory parameter on top level). Otherwise caller won't be able to cancel running operation (timeouts).

Copy link
Owner Author

Choose a reason for hiding this comment

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

It's definitely something I want to do. I might miss more. Need to find a Rider plugin to help me catch it.

# Conflicts:
#	src/SharpCompress/Archives/GZip/GZipArchive.cs
#	src/SharpCompress/Common/GZip/GZipFilePart.cs
#	src/SharpCompress/Common/Tar/Headers/TarHeader.cs
#	src/SharpCompress/Common/Zip/SeekableZipHeaderFactory.cs
#	src/SharpCompress/Common/Zip/ZipFilePart.cs
#	src/SharpCompress/Compressors/Deflate/ZlibBaseStream.cs
#	src/SharpCompress/Compressors/LZMA/LZipStream.cs
#	src/SharpCompress/Compressors/Xz/BinaryUtils.cs
#	src/SharpCompress/Compressors/Xz/Crc32.cs
#	src/SharpCompress/Writers/Tar/TarWriter.cs
#	src/SharpCompress/Writers/Zip/ZipCentralDirectoryEntry.cs
#	src/SharpCompress/Writers/Zip/ZipWriter.cs
@Ilanlido
Copy link

is there any plan on continuing this work?

@adamhathcock
Copy link
Owner Author

Not from me anytime soon as my personal and professional life is too busy. Sorry.

@BloodShadow174
Copy link

Hi. Can we expect asynchrony support in the near future?

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.

None yet

4 participants