-
Notifications
You must be signed in to change notification settings - Fork 20
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
Simplify Server registration #205
base: master
Are you sure you want to change the base?
Conversation
@sagikazarmark marked as Draft because no tests included and documentation should be updated too. If this proposal is applicable, will invest more time for it. |
|
||
/** | ||
* @see {{ .Service | phpServiceName .File }} | ||
* | ||
* Generated from protobuf service <code>{{ .Service.Desc.FullName }}</code> | ||
*/ | ||
final class {{ .Service | phpServiceName .File }}Server implements RequestHandlerInterface | ||
final class {{ .Service | phpServiceName .File }}Server implements ServerInterface |
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.
Swapped it to the new interface, because it is extending RequestHandlerInterface
Thanks @antonkomarev ! I think this makes sense, although in the past I avoided adding additional dependency on the shared library on purpose, mostly to avoid incompatibility between the generated code and the shared library. Let me sleep on it before accepting. |
Looks like I described that exact same solution in #89 though, but never got to implementing it...probably because it meant adding an interface to the runtime library. |
@sagikazarmark so, you didn't changed your mind from then? ) I think it's redundant to define prefix manually if we already have it in a service object. |
I haven't really given it much thought. I can see how the current UX is not ideal. I'm leaning towards accepting this, I just want to give it some thought to see if we can find an alternate solution. |
@sagikazarmark what's wrong with the external interface? Code is generated and doesn't mean to be committed to the application repository. Maybe only in tests. |
Overview
Simplify registration of server, because PATH_PREFIX constant declares:
What this PR does / why we need it
Instead of this:
Or this:
We can do:
Special notes for your reviewer
New ServerInterface may have new method
getMethodPath
described here:Does this PR introduce a user-facing change?