dotnet/runtime

[Analyzer] Async methods that don't take a CancellationToken

开放

#78,397 创建于 2022年11月15日

 (7 条评论) (11 个反应) (1 位负责人)C# (5,445 个派生)batch import
api-approvedarea-System.Threading.Taskscode-analyzerhelp wanted

仓库指标

星标
 (17,886 个星标)
PR 合并指标
 (平均合并 12天 11小时) (30 天内合并 661 个 PR)

描述

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.

贡献者指南