Skip to content

Update all async API methods to use "Async" suffix #177

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

Closed
daviwil opened this issue Mar 1, 2016 · 8 comments
Closed

Update all async API methods to use "Async" suffix #177

daviwil opened this issue Mar 1, 2016 · 8 comments
Labels
Issue-Enhancement A feature request (enhancement). Up for Grabs Will shepherd PRs.

Comments

@daviwil
Copy link
Contributor

daviwil commented Mar 1, 2016

In our work to clean up the API for a stable 1.0 release later this year, we'll need to decide whether we want to use the "Async" suffix on any async methods so that their usage is clear. I personally don't like the suffix but I can understand why it's useful. I wonder if the general guidelines for the usage of this suffix will go away as more and more .NET API methods become async.

Thoughts?

@daviwil daviwil added the Issue-Discussion Let's talk about it. label Mar 1, 2016
@daviwil daviwil added this to the 1.0 milestone Mar 1, 2016
@rkeithhill
Copy link
Contributor

I think async methods should be suffixed with Async. The Microsoft prescribed guidance is:

The name of an async method, by convention, ends with an "Async" suffix.

From https://msdn.microsoft.com/en-us/library/hh191443.aspx.

I see Stephen Cleary using the convention consistently in the "Concurrency in C# Cookbook". Yep, been reading through it. Thanks for the recommend. :-)

@daviwil
Copy link
Contributor Author

daviwil commented Mar 1, 2016

It's a good book! Alright, we'll use *Async. It'd definitely eliminate confusion about which methods should be called with await. Any new async methods you add in the meantime, feel free to use the Async suffix.

@rkeithhill
Copy link
Contributor

Will do.

@daviwil daviwil added Issue-Enhancement A feature request (enhancement). and removed Issue-Discussion Let's talk about it. labels Mar 1, 2016
@daviwil daviwil changed the title Should async API methods end with "Async" suffix? Update all async API methods to use "Async" suffix Mar 1, 2016
@daviwil daviwil modified the milestones: 1.0, May 2017 May 10, 2017
@daviwil daviwil modified the milestones: June 2017, Backlog Oct 27, 2017
@dee-see
Copy link
Contributor

dee-see commented Oct 28, 2018

Is this still planned? I don't mind doing it. Should the PR be against the 2.0.0 branch?

@TylerLeonhardt
Copy link
Member

It's on the backlog for sure - no one's actively working on it AFAIK. Against 2.0.0 is probably the right approach!

@dee-see
Copy link
Contributor

dee-see commented Oct 28, 2018

Ok I'll pick this one up then if it's up for grabs for anyone.

Should a method that returns a Task but isn't marked with async be suffixed with -Async anyway?

@TylerLeonhardt TylerLeonhardt added the Up for Grabs Will shepherd PRs. label Oct 28, 2018
@TylerLeonhardt
Copy link
Member

If it returns a task, then the function is expecting it to be awaited so I say add it.

@NageshAndani
Copy link

This issue needs to be closed as it is fixed by @dee-see #792

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Mar 29, 2021
@andyleejordan andyleejordan removed the Needs: Maintainer Attention Maintainer attention needed! label Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement A feature request (enhancement). Up for Grabs Will shepherd PRs.
Projects
None yet
Development

No branches or pull requests

7 participants