MCPcopy
hub / github.com/ContainerSSH/ContainerSSH / Add

Method Add

service/pool_impl.go:29–41  ·  view source on GitHub ↗
(s Service)

Source from the content-addressed store, hash-verified

27}
28
29func (p *pool) Add(s Service) Lifecycle {
30 p.mutex.Lock()
31 if p.running {
32 panic("bug: pool already running, cannot add service")
33 }
34 defer p.mutex.Unlock()
35 l := p.lifecycleFactory.Make(s)
36 l.OnStateChange(p.onServiceStateChange)
37 p.serviceStates[s] = StateStopped
38 p.services = append(p.services, s)
39 p.lifecycles[s] = l
40 return l
41}
42
43func (p *pool) RunWithLifecycle(lifecycle Lifecycle) error {
44 p.mutex.Lock()

Callers

nothing calls this directly

Calls 2

MakeMethod · 0.65
OnStateChangeMethod · 0.65

Tested by

no test coverage detected