timonkrebs / MemoizR

Declarative Structured Concurrency for C#
Apache License 2.0
106 stars 3 forks source link

create analyzer that ensures every task is awaited in scope #21

Open timonkrebs opened 12 months ago

timonkrebs commented 12 months ago

No Task should be stored in a variable to ensure structured sequential concurrency.

https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-disposeasync

Maybe there is a way to force await at the end of the scope which would probably be fine to.

Like: StructuredTaskScope

https://howtodoinjava.com/java/multi-threading/structured-concurrency/#3-implementing-structured-concurrency-with-structuredtaskscope

timonkrebs commented 11 months ago

https://github.com/microsoft/vs-threading/blob/main/doc/analyzers/index.md

https://github.com/DotNetAnalyzers/AsyncUsageAnalyzers/blob/master/AsyncUsageAnalyzers/AsyncUsageAnalyzers.Test/Usage/UseConfigureAwaitUnitTests.cs

https://github.com/DotNetAnalyzers/AsyncUsageAnalyzers/blob/master/AsyncUsageAnalyzers/AsyncUsageAnalyzers/Usage/UseConfigureAwaitAnalyzer.cs

https://github.com/microsoft/vs-threading/blob/main/doc/analyzers/VSTHRD103.md

https://learn.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/tutorials/how-to-write-csharp-analyzer-code-fix

timonkrebs commented 2 months ago

<WarningsAsErrors>CS4014</WarningsAsErrors> https://github.com/semihokur/AsyncFixer