20 lines
475 B
Go
20 lines
475 B
Go
package client
|
|
|
|
import (
|
|
crc "git.loafle.net/commons_go/rpc/client"
|
|
crcrs "git.loafle.net/commons_go/rpc/client/rwc/socket"
|
|
crr "git.loafle.net/commons_go/rpc/registry"
|
|
)
|
|
|
|
func New(addr string, rpcInvoker crr.RPCInvoker) crc.Client {
|
|
clientHandler := newClientHandler(rpcInvoker)
|
|
socketHandler := newSocketHandler()
|
|
|
|
socketBuilder := NewSocketBuilder(addr, socketHandler)
|
|
cRWCHandler := crcrs.New(socketBuilder)
|
|
|
|
c := crc.New(clientHandler, cRWCHandler)
|
|
|
|
return c
|
|
}
|