-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid awaiting inside a method where you don't need to run any continuation #24
Comments
I'd been thinking of adding this, and a few other await style analyzers. Where should this be added to? Should there be a separate async analyzer or should it go in the core DotNetAnalyzers? |
I don't have a ton of experience with organizations. Is creating the repo something I can do or something you all have to do? This is actually something I'm rather eager to get started on (well analyzers and async in general). |
I'll create it for you and make you an admin on it so you can set it up 👍 |
@sharwell awesome, thanks! |
Best thing I can suggest is start creating issues in the new AsyncUsageAnalyzers repository. If you make a copy of any existing ones which are currently proposals we can close those. |
There are also really useful async analyzers inside AsyncPackage sample from Roslyn code base. I guess they are just there for the team to play around and they don't intend to ship these (my assumption only). Would that be OK to get those in here as well? |
@jaredpar If you get your initial project structure checked in, it will be easier for @BillWagner to start working in parallel with you. 👍 |
We should make sure to directly return the
Task
orTask<T>
object withoutawait
ing inside a method where you don't need to run any continuation. For instance:The
GetBarsAsync
method here doesn't need to await on the_bar.GetBarAsync
method call. It can just directly return the result as below:Cases to Cover
ConfigureAwait(false)
needs to be covered and it should be omitted on the modified code.The text was updated successfully, but these errors were encountered: