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

Use ConfigureAwait(false) for all awaits #59

Closed
DSaunders opened this issue Jun 19, 2019 · 4 comments
Closed

Use ConfigureAwait(false) for all awaits #59

DSaunders opened this issue Jun 19, 2019 · 4 comments

Comments

@DSaunders
Copy link

DSaunders commented Jun 19, 2019

To avoid deadlocks when forced to block on async code (for example, when migrating from a mostly synchronous codebase to async/await), and for performance reasons, it would be helpful to add ConfigureAwait(false) wherever await is used (Async/Await - Best Practices in Asynchronous Programming).

Was it a deliberate decision not to use ConfigureAwait(false), or would you be open to a PR adding this to all async calls?

@tmenier
Copy link
Owner

tmenier commented Jun 23, 2019

No, it wasn't deliberate. I would accept a PR.

I still would never recommend using AsyncPoco unless all calls are made synchronously (stick with PetaPoco or something else in that case). Also note that if you're using ASP.NET Core, ConfigureAwait doesn't matter because there is no SynchronizationContext. That said, no argument that it's still considered a best practice for libraries.

@tmenier
Copy link
Owner

tmenier commented Jul 15, 2019

Sorry for the delay. Looks good to me, I'll get it released. Thanks!

@tmenier
Copy link
Owner

tmenier commented Jul 15, 2019

This has been released and published to NuGet in 2.0.2

@tmenier tmenier closed this as completed Jul 15, 2019
@DSaunders
Copy link
Author

Thank you! 👍

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

2 participants