MCPcopy
hub / github.com/cloudflare/tableflip / newUpgrader

Function newUpgrader

upgrader.go:78–108  ·  view source on GitHub ↗
(env *env, opts Options)

Source from the content-addressed store, hash-verified

76}
77
78func newUpgrader(env *env, opts Options) (*Upgrader, error) {
79 if initialWD == "" {
80 return nil, errors.New("couldn't determine initial working directory")
81 }
82
83 parent, files, err := newParent(env)
84 if err != nil {
85 return nil, err
86 }
87
88 if opts.UpgradeTimeout <= 0 {
89 opts.UpgradeTimeout = DefaultUpgradeTimeout
90 }
91
92 u := &Upgrader{
93 env: env,
94 opts: opts,
95 parent: parent,
96 parentErr: make(chan error, 1),
97 readyC: make(chan struct{}),
98 stopC: make(chan struct{}),
99 upgradeC: make(chan chan<- error),
100 exitC: make(chan struct{}),
101 exitFd: make(chan neverCloseThisFile, 1),
102 Fds: newFds(files, opts.ListenConfig),
103 }
104
105 go u.run()
106
107 return u, nil
108}
109
110// Ready signals that the current process is ready to accept connections.
111// It must be called to finish the upgrade.

Callers 5

newTestUpgraderFunction · 0.85
TestUpgraderOnOSFunction · 0.85
BenchmarkUpgradeFunction · 0.85
NewFunction · 0.85

Calls 3

runMethod · 0.95
newParentFunction · 0.85
newFdsFunction · 0.85

Tested by 4

newTestUpgraderFunction · 0.68
TestUpgraderOnOSFunction · 0.68
BenchmarkUpgradeFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…