-
Notifications
You must be signed in to change notification settings - Fork 506
Open
Labels
Description
Currently, all the async function seems will call the "Sync" one and simply return a Task.CompleteTask.
However, this is not the real async function and will block the caller thread until the operation complete. Therefore, it's no difference than the sync one. Make sure that you implement the async function separately. For example: use underlying stream async function: Stream.WriteAsync() Stream.ReadAsync() Stream.FlushAsync()
sharpcompress/src/SharpCompress/Writers/AbstractWriter.cs
Lines 27 to 38 in 2a3086a
| public virtual async Task WriteAsync( | |
| string filename, | |
| Stream source, | |
| DateTime? modificationTime, | |
| CancellationToken cancellationToken = default | |
| ) | |
| { | |
| // Default implementation calls synchronous version | |
| // Derived classes should override for true async behavior | |
| Write(filename, source, modificationTime); | |
| await Task.CompletedTask.ConfigureAwait(false); | |
| } |
Reactions are currently unavailable