use default router

This commit is contained in:
Asim Aslam 2019-01-14 21:45:43 +00:00
parent c1d0237370
commit e362466e8a

View File

@ -38,7 +38,7 @@ func newRpcServer(opts ...Option) Server {
options := newOptions(opts...) options := newOptions(opts...)
return &rpcServer{ return &rpcServer{
opts: options, opts: options,
router: newRpcRouter(), router: DefaultRouter,
handlers: make(map[string]Handler), handlers: make(map[string]Handler),
subscribers: make(map[*subscriber][]broker.Subscriber), subscribers: make(map[*subscriber][]broker.Subscriber),
exit: make(chan chan error), exit: make(chan chan error),
@ -188,12 +188,6 @@ func (s *rpcServer) Init(opts ...Option) error {
for _, opt := range opts { for _, opt := range opts {
opt(&s.opts) opt(&s.opts)
} }
// update router
r := newRpcRouter()
r.serviceMap = s.router.serviceMap
s.router = r
s.Unlock() s.Unlock()
return nil return nil
} }