Make it possible to have async methods that don't open a new scope for AsyncLocals #107976
Unanswered
erik-kallen
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Sometimes it's useful to have async methods that don't open a new scope for eg. AsyncLocals.
For example:
This is apparently possible with an awful lot of ugly reflection, but it would be nice to have some supported solution. I assume that the
AsyncTaskMethodBuilderAttribute
could be used (eg.[AsyncTaskMethodBuilder(typeof(UseParentExecutionContextMethodBuilder))]
.I assume this could theoretically be implemented in user code, but it's rather complex and not much of the existing infrastructure can be reused because everything is internal.
Beta Was this translation helpful? Give feedback.
All reactions