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

Add Support for ConfigureAwaitOptions in .NET 8 #189

Merged
merged 6 commits into from
Nov 13, 2023

Conversation

brminnick
Copy link
Owner

This PR adds support for ConfigureAwaitOptions in .NET 8.0+


.NET 8.0 Introduces ConfigureAwaitOptions that allow users to customize the behavior when awaiting:

  • ConfigureAwaitOptions.None
    • No options specified
  • ConfigureAwaitOptions.SuppressThrowing
    • Avoids throwing an exception at the completion of awaiting a Task that ends in the Faulted or Canceled state
  • ConfigureAwaitOptions.ContinueOnCapturedContext
    • Attempts to marshal the continuation back to the original SynchronizationContext or TaskScheduler present on the originating thread at the time of the await
  • ConfigureAwaitOptions.ForceYielding
    • Forces an await on an already completed Task to behave as if the Task wasn't yet completed, such that the current asynchronous method will be forced to yield its execution

For more information, check out Stephen Cleary's blog post, "ConfigureAwait in .NET 8".

@brminnick brminnick merged commit 6ef4fe6 into main Nov 13, 2023
5 checks passed
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.

None yet

1 participant