You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Asynchronous operations free up the main thread, allowing it to handle other tasks or enter an idle state, which can lead to lower CPU usage and power consumption. Efficient resource utilization minimizes the overall environmental footprint of applications by reducing the time resources are held, lowering server load, and improving scalability.
Therefore, resources that implement IAsyncDisposable should be disposed asynchronously whenever possible.
When can it be ignored ?
This rule shouldn't be ignored.
Examples
publicstaticvoidTest(){usingvarstream=new MemoryStream();// Compliant, method is synchronous}
publicstaticasync Task Test(){usingvarstream=new MemoryStream();// Non-compliant, can be disposed asynchronously}
Category : Usage
Severity : Warning
Why is this an issue ?
Asynchronous operations free up the main thread, allowing it to handle other tasks or enter an idle state, which can lead to lower CPU usage and power consumption. Efficient resource utilization minimizes the overall environmental footprint of applications by reducing the time resources are held, lowering server load, and improving scalability.
Therefore, resources that implement
IAsyncDisposable
should be disposed asynchronously whenever possible.When can it be ignored ?
This rule shouldn't be ignored.
Examples
The text was updated successfully, but these errors were encountered: