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
Conversation
server.go
Outdated
// | ||
// This API is EXPERIMENTAL. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
// RegisterService registers a service and its implementation to the | ||
// concrete type implementing this interface. It is called from the IDL | ||
// generated code. |
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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{}) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Sorry, I missed a thing. You need to add a 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". |
This was missed out in grpc#3816.
No description provided.