-
Notifications
You must be signed in to change notification settings - Fork 816
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
Moved RPC related types to a dedicated package #4505
Moved RPC related types to a dedicated package #4505
Conversation
Pull Request Test Coverage Report for Build d6fcb8ae-0329-4864-8f23-1582e6a7502b
💛 - Coveralls |
common/rpc/factory.go
Outdated
config *RPC | ||
// Factory is an implementation of service.RPCFactory interface | ||
type Factory struct { | ||
config config.RPC | ||
serviceName string | ||
ch *tchannel.ChannelTransport |
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.
nit and not directly related to this change: rename ch to tchannel?
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.
Agree, fixed.
common/rpc/factory.go
Outdated
func newRPCFactory(cfg *RPC, sName string, logger log.Logger, grpcPorts GRPCPorts) *RPCFactory { | ||
factory := &RPCFactory{config: cfg, serviceName: sName, logger: logger, grpcPorts: grpcPorts} | ||
return factory | ||
func NewFactory(sName string, cfg config.RPC, logger log.Logger, grpcPorts GRPCPorts) *Factory { |
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.
nit and not directly related to this change: sName -> name or service
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.
Agree, fixed.
What changed?
Moved RPC related stuff from
config
package to a dedicatedrpc
package, with minor renaming and splitting into files.Why?
These types contain significant amount of RPC related logic, that IMO deserves their own place. Those are not very config related.
Also, this serves as a first refactoring step for further changes planned. Specifically unifying how dispatchers are created and used. This includes
DispatcherProvider
and all related stuff such asdnsDispatcherProvider
,dnsUpdater
, etc. Currently they lie underclient
package. In the end, these types will end up here as well.How did you test it?
Existing tests.
Potential risks
None, only mechanical move.
Release notes
Documentation Changes