ing
This commit is contained in:
parent
f3ea7a8fed
commit
f762f59aef
|
@ -10,7 +10,7 @@ import (
|
||||||
type ServerHandler interface {
|
type ServerHandler interface {
|
||||||
cwf.ServerHandler
|
cwf.ServerHandler
|
||||||
|
|
||||||
RegisterServlet(entryPath string, servletHandler servlet.ServletHandler)
|
RegisterServlet(servletName string, servletHandler servlet.ServletHandler)
|
||||||
RegisterRPCGatewayServlet(entryPath string, rpcGatewayHandler rpc.RPCGatewayHandler) servlet.ServletHandler
|
RegisterRPCGatewayServlet(servletName string, rpcGatewayHandler rpc.RPCGatewayHandler) servlet.ServletHandler
|
||||||
RegisterSubscriber(subscriberHandler oos.SubscriberHandler)
|
RegisterSubscriber(subscriberHandler oos.SubscriberHandler)
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,10 +67,10 @@ func (sh *ServerHandlers) OnStop() {
|
||||||
sh.ServerHandlers.OnStop()
|
sh.ServerHandlers.OnStop()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sh *ServerHandlers) RegisterServlet(entryPath string, servletHandler servlet.ServletHandler) {
|
func (sh *ServerHandlers) RegisterServlet(servletName string, servletHandler servlet.ServletHandler) {
|
||||||
cfg := config.Config.Servlets[entryPath]
|
cfg := config.Config.Servlets[servletName]
|
||||||
if nil == cfg {
|
if nil == cfg {
|
||||||
logging.Logger().Panic(fmt.Sprintf("Gateway Websocket: config of entry path[%s] is not exist", entryPath))
|
logging.Logger().Panic(fmt.Sprintf("Gateway Websocket: config of servlet[%s] is not exist", servletName))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,14 +84,14 @@ func (sh *ServerHandlers) RegisterServlet(entryPath string, servletHandler servl
|
||||||
servletH.PingPeriod = cfg.Socket.PingPeriod * time.Second
|
servletH.PingPeriod = cfg.Socket.PingPeriod * time.Second
|
||||||
// servletH.BinaryMessage = cfg.Socket.BinaryMessage
|
// servletH.BinaryMessage = cfg.Socket.BinaryMessage
|
||||||
|
|
||||||
sh.RegisterSocketHandler(entryPath, servletH)
|
sh.RegisterSocketHandler(cfg.Entry, servletH)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sh *ServerHandlers) RegisterRPCGatewayServlet(entryPath string, rpcGatewayHandler rpc.RPCGatewayHandler) servlet.ServletHandler {
|
func (sh *ServerHandlers) RegisterRPCGatewayServlet(servletName string, rpcGatewayHandler rpc.RPCGatewayHandler) servlet.ServletHandler {
|
||||||
cfg := config.Config.Servlets[entryPath]
|
cfg := config.Config.Servlets[servletName]
|
||||||
if nil == cfg {
|
if nil == cfg {
|
||||||
logging.Logger().Panic(fmt.Sprintf("Gateway Websocket: config of entry path[%s] is not exist", entryPath))
|
logging.Logger().Panic(fmt.Sprintf("Gateway Websocket: config of servlet[%s] is not exist", servletName))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ func (sh *ServerHandlers) RegisterRPCGatewayServlet(entryPath string, rpcGateway
|
||||||
rpcSHs.PingTimeout = cfg.Socket.PingTimeout * time.Second
|
rpcSHs.PingTimeout = cfg.Socket.PingTimeout * time.Second
|
||||||
rpcSHs.PingPeriod = cfg.Socket.PingPeriod * time.Second
|
rpcSHs.PingPeriod = cfg.Socket.PingPeriod * time.Second
|
||||||
|
|
||||||
sh.RegisterSocketHandler(entryPath, rpcSHs)
|
sh.RegisterSocketHandler(cfg.Entry, rpcSHs)
|
||||||
|
|
||||||
return rpcSH
|
return rpcSH
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user