grpc / grpc/grpc

Option to append `Async` to server side method names

Open
#39,010 2 comments 0 reactions 1 assignee Claimed by @apolcyn View on GitHub
kind/enhancement lang/C# priority/P2
Dominant language
C++
Stars
45.3k
Forks
11.4k
Avg merge
2d 12h
Merged PRs (30d)
47

Description

### Is your feature request related to a problem? Please describe.
Currently if I have a proto file with the following:
```proto
service MyService {
rpc MyMethod (MyRequest) returns (MyReply);
}
```

It will generate a C# method with the following format:
```csharp
public override async Task MyMethod(MyRequest request, ServerCallContext context)
```

### Describe the solution you'd like
It would be nice if there was an option to append `Async` to these generated methods to keep with the general naming convention in C# where asynchronous methods are suffixed with `Async`. Which will otherwise trigger analyzer warnings.

The desired generated code would be:
```csharp
public override async Task MyMethodAsync(MyRequest request, ServerCallContext context)
```

### Describe alternatives you've considered
Disabling the analyzer warnings, but that seems the wrong approach.

### Additional context
This feature was requested in [#7874](https://github.com/grpc/grpc/issues/7874) a very long time ago but has since then been locked so I couldn't add a comment there instead, hence the new issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.