Skip to content
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

server: Add ServiceRegistrar interface. #3816

Merged
merged 2 commits into from Aug 14, 2020
Merged

Conversation

easwars
Copy link
Contributor

@easwars easwars commented Aug 14, 2020

No description provided.

@easwars easwars requested a review from dfawley August 14, 2020 00:50
@easwars easwars added no release notes Type: API Change Breaking API changes (experimental APIs only!) labels Aug 14, 2020
server.go Outdated
Comment on lines 546 to 547
//
// This API is EXPERIMENTAL.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can't be experimental if we use it in stable generated code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm ....
Done.

server.go Outdated
Comment on lines 549 to 551
// RegisterService registers a service and its implementation to the
// concrete type implementing this interface. It is called from the IDL
// generated code.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// RegisterService registers a service and its implementation to the
// concrete type implementing this interface.   It may not be called
// once the server has started serving.

(I think we can omit the bit about generated code here.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

server.go Outdated
// generated code.
//
// This API is EXPERIMENTAL.
RegisterService(*ServiceDesc, interface{})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name these parameters:

desc *ServiceDesc, impl interface{}

And document them above:

// desc describes the service and its methods and handlers.  impl is the service
// implementation which is passed to the method handers*.

* - for some reason we can't explain.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@easwars easwars merged commit f30caa9 into grpc:master Aug 14, 2020
@easwars easwars deleted the server_registrar branch August 14, 2020 17:26
@dfawley
Copy link
Member

dfawley commented Aug 14, 2020

Sorry, I missed a thing. You need to add a SupportPackageIsVersion7 for this.

https://github.com/grpc/grpc-go/blob/master/rpc_util.go#L879

Technically it isn't actually necessary, but it does give a better signal that the user is using too old a version of grpc-go vs. "doesn't compile because of some random undefined symbol".

easwars added a commit to easwars/grpc-go that referenced this pull request Aug 14, 2020
easwars added a commit that referenced this pull request Aug 14, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: API Change Breaking API changes (experimental APIs only!)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants