Review AsyncLocals (HeaderPropagation and Action context)
Open
area-middleware
Perf
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 276
Description
Recently merged #9370 included a new use of an async local. Prompting me to search this repo for other uses, only to happily conclude there's not many outside tests. You have #9370, an optional ActionContextAccessor and some for what looks like razor things and the well known HttpContextAccessor.
Are these first two async locals not better expressed as fetching features or info from HttpContext? That would mean small changes of replacing them with a dependency on HttpContextAccessor instead.
Lifetime being the only open question here. Would their behavior become invalid when strictly scoped to request lifetime as HttpContextAccessor is?
Contributor guide
Assessment
This issue has not been assessed yet.