func (n *Nerve) Stop() { logs.Info("Stopping nerve") close(n.serviceStopper) n.stopApi() n.servicesStopWait.Wait() logs.Debug("All services stopped") }
func (s *Synapse) Stop() { logs.Info("Stopping synapse") s.stopApi() close(s.context.stop) s.context.doneWaiter.Wait() logs.Debug("All router stopped") }
func (s *Synapse) Start(oneshot bool) error { logs.Info("Starting synapse") s.context = newContext(oneshot) for _, routers := range s.typedRouters { go routers.Run(s.context) } return s.startApi() }
func (n *Nerve) Start(startStatus chan error) { logs.Info("Starting nerve") if len(n.Services) == 0 { if startStatus != nil { startStatus <- errs.WithF(n.fields, "No service specified") } return } for _, service := range n.Services { go service.Start(n.serviceStopper, &n.servicesStopWait) } res := n.startApi() if startStatus != nil { startStatus <- res } }