Open mycroes opened 1 year ago
Thank you for your suggestion. I'm open to this async PR.
I started working on this, but did some exception cleanup work first in PR #1034. For now I opted for 2 discrete paths (one sync, one async), extracting methods where duplicate code appears. I noticed SharpZipLib actually uses a single method for sync and async writes, which is implemented as async method which never runs async when invoked with sync intention. I didn't really feel very comfortable with that design though, so I decided for the seperate paths. I'm nowhere near done yet, but most of it is pretty smooth sailing.
Async operations are used to avoid blocking threads on IO wait. Unfortunately NPOI currently only supports sync operations when writing documents to streams, which for instance doesn't work with AspNetCore Kestrel defaults that don't permit sync IO. Adding async variants of
Write
methods that take aStream
would permit consumers to choose between sync or async operation.I'm willing to look into the changes required for async
Write
s and submit a PR if you're open to including this.