MCPcopy
hub / github.com/wavetermdev/waveterm / ProcessContextWait

Function ProcessContextWait

pkg/genconn/genconn.go:106–119  ·  view source on GitHub ↗
(ctx context.Context, proc ShellProcessController)

Source from the content-addressed store, hash-verified

104}
105
106func ProcessContextWait(ctx context.Context, proc ShellProcessController) error {
107 done := make(chan error, 1)
108 go func() {
109 done <- proc.Wait()
110 }()
111
112 select {
113 case <-ctx.Done():
114 proc.Kill()
115 return ctx.Err()
116 case err := <-done:
117 return err
118 }
119}
120
121func MakeStdoutSyncBuffer(proc ShellProcessController) (*syncbuf.SyncBuffer, error) {
122 stdout, err := proc.StdoutPipe()

Callers 2

CpWshToRemoteFunction · 0.92
RunSimpleCommandFunction · 0.85

Calls 3

ErrMethod · 0.80
WaitMethod · 0.65
KillMethod · 0.65

Tested by

no test coverage detected