MCPcopy
hub / github.com/ContainerSSH/ContainerSSH / processRunning

Method processRunning

service/pool_impl.go:89–111  ·  view source on GitHub ↗
(lifecycle Lifecycle, stopped bool, startedServices int)

Source from the content-addressed store, hash-verified

87}
88
89func (p *pool) processRunning(lifecycle Lifecycle, stopped bool, startedServices int) int {
90 if !stopped {
91 p.logger.Info(message.NewMessage(message.MServicesRunning, "All services are now running."))
92
93 lifecycle.Running()
94
95 select {
96 case <-p.stopComplete:
97 // One service stopped, initiate shutdown
98 p.logger.Info(message.NewMessage(message.MServicesStopping, "Services are now stopping..."))
99 startedServices--
100 case <-lifecycle.Context().Done():
101 p.logger.Info(message.NewMessage(message.MServicesStopping, "Services are now stopping..."))
102 lifecycle.Stopping()
103 p.triggerStop(lifecycle.ShutdownContext())
104 }
105 } else {
106 p.logger.Info(message.NewMessage(message.MServicesStopping, "Services are now stopping..."))
107 lifecycle.Stopping()
108 p.triggerStop(context.Background())
109 }
110 return startedServices
111}
112
113func (p *pool) runService(service Service) {
114 go func() {

Callers 1

RunWithLifecycleMethod · 0.95

Calls 7

triggerStopMethod · 0.95
NewMessageFunction · 0.92
InfoMethod · 0.65
RunningMethod · 0.65
ContextMethod · 0.65
StoppingMethod · 0.65
ShutdownContextMethod · 0.65

Tested by

no test coverage detected