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

Merge async and not-async implementation #601

Open
shps951023 opened this issue May 18, 2024 · 6 comments
Open

Merge async and not-async implementation #601

shps951023 opened this issue May 18, 2024 · 6 comments
Labels
help wanted Extra attention is needed

Comments

@shps951023
Copy link
Member

No description provided.

@duszekmestre
Copy link
Contributor

What do you mean by this? Maybe I can help

@shps951023
Copy link
Member Author

shps951023 commented May 20, 2024

@duszekmestre ❤thanks, e.g. ExcelOpenXmlSheetWriter.Async.cs and ExcelOpenXmlSheetWriter.cs, their logic and code 99% same, but miniexcel needs duplicate code to use async, Task, await keyword.
I think these code can be merged.

@duszekmestre
Copy link
Contributor

Yes - I tried to do this but I have limited time for doing this. Some code can be reused and in latest PR i refactor one of the method to prepare string values to write them to the writer.

@duszekmestre
Copy link
Contributor

I started to reuse code in PR #602

In the next part I'll try to reuse code between different types of objects on saving.

@duszekmestre
Copy link
Contributor

@duszekmestre ❤thanks, e.g. ExcelOpenXmlSheetWriter.Async.cs and ExcelOpenXmlSheetWriter.cs, their logic and code 99% same, but miniexcel needs duplicate code to use async, Task, await keyword. I think these code can be merged.

I think it is not possible to completely reuse same code. Async/await method should be written separately. The only thing which is possible is creating same codebase to generate XML strings for both implementations to reuse and easier maintenance.

I saw that different types (data reader, data table, enumerable) are managed separately so many errors are done because of lack of implementation to one of them. This the hardest and most important thing to rewrite.

If you have any other idea please share with me.

@shps951023
Copy link
Member Author

shps951023 commented May 23, 2024

Yes, my first idea is we can only maintain async method like HttpClient
sync method just call async method GetAwaiter and GetResult

@shps951023 shps951023 added the help wanted Extra attention is needed label Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
Status: To do
Development

No branches or pull requests

2 participants