ing
This commit is contained in:
parent
38f2405ff3
commit
f3ea7a8fed
|
@ -11,6 +11,6 @@ type ServerHandler interface {
|
||||||
cwf.ServerHandler
|
cwf.ServerHandler
|
||||||
|
|
||||||
RegisterServlet(entryPath string, servletHandler servlet.ServletHandler)
|
RegisterServlet(entryPath string, servletHandler servlet.ServletHandler)
|
||||||
RegisterRPCGatewayServlet(entryPath string, rpcGatewayHandler rpc.RPCGatewayHandler)
|
RegisterRPCGatewayServlet(entryPath string, rpcGatewayHandler rpc.RPCGatewayHandler) servlet.ServletHandler
|
||||||
RegisterSubscriber(subscriberHandler oos.SubscriberHandler)
|
RegisterSubscriber(subscriberHandler oos.SubscriberHandler)
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,14 +88,14 @@ func (sh *ServerHandlers) RegisterServlet(entryPath string, servletHandler servl
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sh *ServerHandlers) RegisterRPCGatewayServlet(entryPath string, rpcGatewayHandler rpc.RPCGatewayHandler) {
|
func (sh *ServerHandlers) RegisterRPCGatewayServlet(entryPath string, rpcGatewayHandler rpc.RPCGatewayHandler) servlet.ServletHandler {
|
||||||
cfg := config.Config.Servlets[entryPath]
|
cfg := config.Config.Servlets[entryPath]
|
||||||
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 entry path[%s] is not exist", entryPath))
|
||||||
return
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
rpcSH := oogwisr.NewRPCGatewayServletHandler()
|
rpcSH := oogwisr.NewRPCGatewayServletHandler(rpcGatewayHandler)
|
||||||
rpcSHs := rpcSH.(*oogwisr.RPCGatewayServletHandlers)
|
rpcSHs := rpcSH.(*oogwisr.RPCGatewayServletHandlers)
|
||||||
|
|
||||||
rpcSHs.MaxMessageSize = cfg.Socket.MaxMessageSize
|
rpcSHs.MaxMessageSize = cfg.Socket.MaxMessageSize
|
||||||
|
@ -106,6 +106,8 @@ func (sh *ServerHandlers) RegisterRPCGatewayServlet(entryPath string, rpcGateway
|
||||||
rpcSHs.PingPeriod = cfg.Socket.PingPeriod * time.Second
|
rpcSHs.PingPeriod = cfg.Socket.PingPeriod * time.Second
|
||||||
|
|
||||||
sh.RegisterSocketHandler(entryPath, rpcSHs)
|
sh.RegisterSocketHandler(entryPath, rpcSHs)
|
||||||
|
|
||||||
|
return rpcSH
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sh *ServerHandlers) RegisterSubscriber(subscriberHandler oos.SubscriberHandler) {
|
func (sh *ServerHandlers) RegisterSubscriber(subscriberHandler oos.SubscriberHandler) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user