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

Disable .ConfigureAwait(false) by conditional compilation constant DO_CONFIGURE_AWAIT_FALSE #337

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

SergeiPavlov
Copy link
Contributor

@SergeiPavlov SergeiPavlov commented Aug 24, 2023

In typical ASP.NET apps .ConfigureAwait(false) creates unnecessary overhead (a few nanoseconds).
.ConfigureAwait(false) makes sense mostly for UI applications, with non-null Synchronization Context

This can be switched off by setting environment variable DO_CONFIGURE_AWAIT_FALSE=false at compile time

…FIGURE_AWAIT

Rename condition  to DO_CONFIGURE_AWAIT_FALSE

Continue replacing .ConfigureAwait(false)
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

Successfully merging this pull request may close these issues.

1 participant