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.

貢獻者指南