mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
模块支持rpc调用
This commit is contained in:
@@ -34,7 +34,7 @@ type IService interface {
|
||||
|
||||
type Service struct {
|
||||
Module
|
||||
rpc.RpcHandler //rpc
|
||||
rpcHandler rpc.RpcHandler //rpc
|
||||
name string //service name
|
||||
wg sync.WaitGroup
|
||||
serviceCfg interface{}
|
||||
@@ -60,7 +60,8 @@ func (s *Service) OpenProfiler() {
|
||||
func (s *Service) Init(iService IService,getClientFun rpc.FuncRpcClient,getServerFun rpc.FuncRpcServer,serviceCfg interface{}) {
|
||||
s.dispatcher =timer.NewDispatcher(timerDispatcherLen)
|
||||
|
||||
s.InitRpcHandler(iService.(rpc.IRpcHandler),getClientFun,getServerFun)
|
||||
s.rpcHandler.InitRpcHandler(iService.(rpc.IRpcHandler),getClientFun,getServerFun)
|
||||
s.IRpcHandler = s
|
||||
s.self = iService.(IModule)
|
||||
//初始化祖先
|
||||
s.ancestor = iService.(IModule)
|
||||
|
||||
Reference in New Issue
Block a user