MCPcopy Create free account
hub / github.com/devspace-sh/devspace / addChild

Method addChild

pkg/util/tomb/context.go:53–69  ·  view source on GitHub ↗
(parent context.Context, child context.Context, cancel func())

Source from the content-addressed store, hash-verified

51}
52
53func (t *Tomb) addChild(parent context.Context, child context.Context, cancel func()) {
54 if t.reason != ErrStillAlive {
55 cancel()
56 return
57 }
58 if t.child == nil {
59 t.child = make(map[interface{}]childContext)
60 }
61 t.child[parent] = childContext{child, cancel, child.Done()}
62 for parent, child := range t.child {
63 select {
64 case <-child.done:
65 delete(t.child, parent)
66 default:
67 }
68 }
69}

Callers 2

WithContextFunction · 0.95
ContextMethod · 0.95

Calls 1

DoneMethod · 0.65

Tested by

no test coverage detected