compiler: Generate interfaces for services to implement#9688
Merged
larry-safran merged 43 commits intogrpc:masterfrom Feb 15, 2023
Merged
compiler: Generate interfaces for services to implement#9688larry-safran merged 43 commits intogrpc:masterfrom
larry-safran merged 43 commits intogrpc:masterfrom
Conversation
Rename TestService to TestServiceAsync Change TestServiceAsync default implementations to be copies of TestServiceImplBase's Change exception type thrown by default implementations of Blocking and Future interaces to UnsupportedOperationException
…nd done for TestServiceGrpc.java.
Member
|
We do not want the client stubs to implement the interfaces; they are final today to prevent mocking. |
ejona86
reviewed
Nov 15, 2022
* Add a bindService(<service>Async) method * Remove methods from BaseImpl that were defaulted in Interface * Fix indentations.
Contributor
Author
|
@ejona86 Ready for rereview. |
…instead of using ImplBase.
Contributor
Author
|
@ejona86 ping |
ejona86
reviewed
Jan 4, 2023
Member
ejona86
left a comment
There was a problem hiding this comment.
Still going through it. Sending what I have.
ejona86
reviewed
Jan 5, 2023
Member
ejona86
left a comment
There was a problem hiding this comment.
Looks good. We need to check if the ExperimentalApi annotations will compile cleanly with grpc-java-api-checker.
ejona86
reviewed
Feb 14, 2023
… alts and revert the ignore of venv.
ejona86
approved these changes
Feb 15, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When generating Java code from an rpc proto, not only generate the ImplBase and stub methods, but also generate an interface named AsyncService containing the async service methods and have the <service>ImplBase classes implement it in addition to BindableService.
All methods for the interfaces are defined with defaults.
The current logic for the methods in <service>ImplBase will be moved to the default methods ofAsyncService and the methods will be removed from <service>ImplBase.
The bindService logic will be moved into the main Grpc class in a method with the signature:
public static final io.grpc.ServerServiceDefinition bindService(<service>Async serviceImpl)fixes #9320