This commit is contained in:
crusader
2018-04-19 23:45:39 +09:00
parent de8a590fd5
commit 0720771a87
3 changed files with 23 additions and 8 deletions

View File

@@ -3,6 +3,7 @@ package server
import (
cdr "git.loafle.net/commons/di-go/registry"
logging "git.loafle.net/commons/logging-go"
crpj "git.loafle.net/commons/rpc-go/protocol/json"
crr "git.loafle.net/commons/rpc-go/registry"
cssn "git.loafle.net/commons/server-go/socket/net"
occa "git.loafle.net/overflow/commons-go/core/annotation"
@@ -13,7 +14,10 @@ import (
)
func New(pidFilePath string) *cssn.Server {
rpcWriteChan := make(chan *container.RPCNotification, 256)
cdr.RegisterResource(container.CONTAINER_CRAWLERS, crawler.GetCrawlers())
cdr.RegisterResource(container.CONTAINER_RPC_WRITE_CHAN, rpcWriteChan)
services, err := cdr.GetInstancesByAnnotationType(occa.RPCServiceAnnotationType)
if nil != err {
@@ -25,6 +29,8 @@ func New(pidFilePath string) *cssn.Server {
ds := &servlet.DiscoveryServlets{}
ds.RPCInvoker = rpcRegistry
ds.RPCWriteChan = rpcWriteChan
ds.RPCServerCodec = crpj.NewServerCodec()
sh := &ServerHandlers{}
sh.Name = "Container Discovery"