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!)
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!)