Make async function real #740

Open
opened 2026-01-29 22:16:42 +00:00 by claunia · 1 comment
Owner

Originally created by @zhuxb711 on GitHub (Dec 8, 2025).

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()

2a3086a0d7/src/SharpCompress/Writers/AbstractWriter.cs (L27-L38)

Originally created by @zhuxb711 on GitHub (Dec 8, 2025). 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()` https://github.com/adamhathcock/sharpcompress/blob/2a3086a0d75e1911ec0aed9b447c00f9d1c9b114/src/SharpCompress/Writers/AbstractWriter.cs#L27-L38
claunia added the enhancement label 2026-01-29 22:16:42 +00:00
Author
Owner

@adamhathcock commented on GitHub (Dec 8, 2025):

I'm definitely working on it. That's for keeping tabs on what's real though. Sometimes I get lost.

@adamhathcock commented on GitHub (Dec 8, 2025): I'm definitely working on it. That's for keeping tabs on what's real though. Sometimes I get lost.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#740