EventSourcing.NetCore icon indicating copy to clipboard operation
EventSourcing.NetCore copied to clipboard

Add analyzer and add bloody `.ConfigureAwait()` where needed 😅

Open oskardudycz opened this issue 2 years ago • 2 comments

oskardudycz avatar Mar 17 '22 10:03 oskardudycz

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 avatar Mar 20 '22 21:03 devbrsa

@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).

oskardudycz avatar Mar 21 '22 07:03 oskardudycz

@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.

oskardudycz avatar Dec 01 '22 18:12 oskardudycz