dotnet/runtime
Ver no GitHub[Analyzer] Async methods that don't take a CancellationToken
Open
#78.397 aberto em 15 de nov. de 2022
api-approvedarea-System.Threading.Taskscode-analyzerhelp wanted
Métricas do repositório
- Stars
- (17.886 stars)
- Métricas de merge de PR
- (Mesclagem média 12d 11h) (661 fundiu PRs em 30d)
Description
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.