dotnet/runtime
GitHub で見る[Analyzer] Async methods that don't take a CancellationToken
Open
#78,397 opened on 2022年11月15日
api-approvedarea-System.Threading.Taskscode-analyzerhelp wanted
Repository metrics
- Stars
- (17,886 stars)
- PR merge metrics
- (平均マージ 12d 11h) (30d で 661 merged PRs)
説明
Cancellation is often important to the scalability of an app / service. If an async method has no way to cancel it, that can impact scalability and responsiveness. We should consider adding an analyzer (likely off by default due to noise) that flags async methods (async and/or Task/ValueTask-returning) that have no overloads which accept a CancellationToken, and issue a diagnostic to consider taking one.