This commit is contained in:
crusader 2018-07-03 00:19:56 +09:00
parent d451098375
commit a8a298aba3

View File

@ -4,6 +4,7 @@ import (
cdr "git.loafle.net/commons/di-go/registry" cdr "git.loafle.net/commons/di-go/registry"
"git.loafle.net/commons/logging-go" "git.loafle.net/commons/logging-go"
crc "git.loafle.net/commons/rpc-go/client" crc "git.loafle.net/commons/rpc-go/client"
crcodec "git.loafle.net/commons/rpc-go/codec"
crpj "git.loafle.net/commons/rpc-go/protocol/json" crpj "git.loafle.net/commons/rpc-go/protocol/json"
crr "git.loafle.net/commons/rpc-go/registry" crr "git.loafle.net/commons/rpc-go/registry"
occp "git.loafle.net/overflow/commons-go/config/probe" occp "git.loafle.net/overflow/commons-go/config/probe"
@ -15,13 +16,13 @@ import (
) )
func New(portNumber int) *crc.Client { func New(portNumber int) *crc.Client {
rpcClientCodec := crpj.NewClientCodec()
connector, err := occ.NewConnector(occp.ContainerDiscovery, portNumber) connector, err := occ.NewConnector(occp.ContainerDiscovery, portNumber)
if nil != err { if nil != err {
logging.Logger().Panic(err) logging.Logger().Panic(err)
} }
rpcClientCodec := crpj.NewCustomClientCodec(crcodec.NewCompressionCodecSelector(connector.GetCompressionThreshold()))
ch := &ClientHandlers{} ch := &ClientHandlers{}
ch.Name = occp.ContainerDiscovery.String() ch.Name = occp.ContainerDiscovery.String()
ch.Connector = connector ch.Connector = connector