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

[Question] Async over sync during app start #17

Open
lonix1 opened this issue Oct 31, 2021 · 0 comments
Open

[Question] Async over sync during app start #17

lonix1 opened this issue Oct 31, 2021 · 0 comments

Comments

@lonix1
Copy link

lonix1 commented Oct 31, 2021

Hello again Henk,

Another quick question. In this line you use GetAwaiter().GetResult() to run async-over-sync.

I'm always hesitant to do that because the number of edge cases makes my brain hurt. In this case though it should happen only once during app start, so there should not be typical problems like thread pool starvation, deadlocks, etc. - I hope! Also there is not another way I can think of.

Do you feel the current implementation is "safe"?

(Also, it may be better to do Task.Run(() => /*...*/).GetAwaiter().GetResult() instead of ().GetAwaiter().GetResult() ...maybe. I'm not an async expert!)

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

No branches or pull requests

1 participant