oskardudycz/EventSourcing.NetCore

Add analyzer and add bloody `.ConfigureAwait()` where needed πŸ˜…

oskardudycz opened this issue Β· 3 comments

Add analyzer and add bloody `.ConfigureAwait()` where needed πŸ˜…

You Don’t Need ConfigureAwait(false), But Still Use It in Libraries
Since there is no context anymore, there’s no need for ConfigureAwait(false). Any code that knows it’s running under ASP.NET Core does not need to explicitly avoid its context. In fact, the ASP.NET Core team themselves have dropped the use of ConfigureAwait(false)

https://blog.stephencleary.com/2017/03/aspnetcore-synchronization-context.html

@devbrsa thanks for the feedback. Indeed we throw away some time ago .ConfigureAwait(false) in Marten, yet we had to bring it back because of MS Orleans, Blazor etc. having deadlock issues. I created this issue to remind myself of having a decision about that. I may drop this idea (I'd love to, as it's incredibly annoying).

@devbrsa, I decided to do that in #188, as I already had deadlocks in testing code, plus it's good to set the example, as it's safer to have such code in core libraries. I didn't apply that to the business and API code.