Distribt
Distribt copied to clipboard
Create shared.awaiter
in some scenarios (mainly config) we are executing async communication in non-async flows. for that reason instead of doing just .Result
i should write a wrapper around it like Awaiter.Execute
or something like that that executes that piece of code.
I was searching the places this situation happens. I found that only appear on dependency injection situations
Look all the .Result
places:
There are many places to touch but I think it can be possible using async and await sentences. For example I tried with SecretManager class:
- in the class:
- In the web application creation (there are many but this is an example):
- and the Program.cs
In this way al process are asynchronous but there is necessary change many files (I can do it if you want and you are agree)
@AlexScigalszky yep it is for the DI I will need to think if there is any implication on converting sync
scenarios in async
but I dont think so. It's a better solution that the wrapper around the result, that's for sure 😂
Yo can do it if you are bored or you want to contribute :D, otherwise i will do it probably during the wekend. At the end of the day, the code is not being used in production (at least by me) so there is no rush. haha.
@ElectNewt I already did a big part of this changes (just to be sure my idea is good). Now I finish all changes that you can see in this PR (please don't merge it yet): https://github.com/ElectNewt/Distribt/pull/35
I tried to run but I got this error, can you help me?
🤔 thats sounds familiar. I think that is the reason why I was thinking in the shared awaiter library
It took a long time but finally, I did it!
I create an async version of DefaultDistribtWebApplication.Create() method
Please, feel free to review and comment on any improvement in the PR: https://github.com/ElectNewt/Distribt/pull/35