MCPcopy Create free account
hub / github.com/encodeous/nylon / Start

Method Start

core/nylon.go:240–261  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

238}
239
240func (n *Nylon) Start() error {
241 n.Log.Info("init modules complete")
242
243 n.Log.Info("Nylon has been initialized. To gracefully exit, send SIGINT or Ctrl+C.")
244
245 c := make(chan os.Signal, 1)
246 signal.Notify(c, syscall.SIGINT, syscall.SIGTERM)
247 go func() {
248 select {
249 case _ = <-c:
250 n.Cancel(errors.New("received shutdown signal"))
251 case <-n.Context.Done():
252 return
253 }
254 }()
255
256 err := n.mainLoop()
257 if err != nil {
258 return err
259 }
260 return nil
261}
262
263func (n *Nylon) Stop() {
264 n.cleanupOnce.Do(func() {

Callers 2

StartMethod · 0.95
BootstrapFunction · 0.95

Calls 2

mainLoopMethod · 0.95
CancelMethod · 0.45

Tested by

no test coverage detected