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

Async API introduction #38

Open
mzhavoronkov opened this issue Jan 1, 2024 · 3 comments
Open

Async API introduction #38

mzhavoronkov opened this issue Jan 1, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@mzhavoronkov
Copy link

Hi ! I have a question regarding the implementation of the library: will there be any plans for async API for Excel writer? This may seem exotic but it's actually very useful: let's say you want to write an excel file to some external location (for example, AWS S3). You have implemented a new AmazonS3Stream (derived from Stream) for that purpose which sends some requests from time to time using AWS API. Those requests are asynchronous which means that whole new AmazonS3Stream is asynchronous as well. But async Stream API is not supported by the library, so you will need to put GetAwaiter().GetResult() everywhere, which is not very nice :(

So, what would you think if we introduce that into the library? I can help if help is needed.

@salvois salvois added the enhancement New feature or request label Jan 1, 2024
@salvois
Copy link
Owner

salvois commented Jan 1, 2024

Hi @mzhavoronkov ,
that definitely makes sense! Kestrel-based writers may benefit from this too.
Thanks for your suggestion, I'll think about it.
Salvo

@AntonyCorbett
Copy link
Contributor

Exposing async and sync methods can be a maintenance headache. A possible solution is the "bool hack" described here by Steven Toub / Stephen Cleary: https://learn.microsoft.com/en-us/archive/msdn-magazine/2015/july/async-programming-brownfield-async-development#the-flag-argument-hack

@AntonyCorbett
Copy link
Contributor

AntonyCorbett commented Jan 1, 2025

We'd also need to support async disposal, but IAsyncDisposable is not available in NET Standard 2.0. So we'd need a finalizer workaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants