MCPcopy
hub / github.com/docker/docker-agent / Connect

Method Connect

pkg/tools/lifecycle/supervisor_test.go:111–127  ·  view source on GitHub ↗
(context.Context)

Source from the content-addressed store, hash-verified

109}
110
111func (c *scriptedConnector) Connect(context.Context) (lifecycle.Session, error) {
112 c.calls.Add(1)
113 c.mu.Lock()
114 if c.idx >= len(c.scripts) {
115 c.mu.Unlock()
116 return nil, errors.New("scripted connector exhausted")
117 }
118 step := c.scripts[c.idx]
119 c.idx++
120 c.mu.Unlock()
121
122 if step.err != nil {
123 return nil, step.err
124 }
125 c.delivered <- step.session
126 return step.session, nil
127}
128
129func (c *scriptedConnector) Calls() int { return int(c.calls.Load()) }
130

Callers

nothing calls this directly

Calls 4

AddMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45
NewMethod · 0.45

Tested by

no test coverage detected