Process manages one subprocess and its optional JSON-RPC transport.
| 79 | |
| 80 | // Process manages one subprocess and its optional JSON-RPC transport. |
| 81 | type Process struct { |
| 82 | cmd *exec.Cmd |
| 83 | stdin io.WriteCloser |
| 84 | stdout io.ReadCloser |
| 85 | stderr *boundedBuffer |
| 86 | logger *slog.Logger |
| 87 | |
| 88 | transport *transport |
| 89 | |
| 90 | lifecycleCtx context.Context |
| 91 | cancelLifecycle context.CancelFunc |
| 92 | |
| 93 | done chan struct{} |
| 94 | waitMu sync.RWMutex |
| 95 | waitErr error |
| 96 | stopRequested bool |
| 97 | stopMu sync.RWMutex |
| 98 | closeInputMu sync.Mutex |
| 99 | inputClosed bool |
| 100 | |
| 101 | stateMu sync.RWMutex |
| 102 | state processState |
| 103 | |
| 104 | transportErrMu sync.RWMutex |
| 105 | transportErr error |
| 106 | |
| 107 | shutdownTimeout time.Duration |
| 108 | postSignalGrace time.Duration |
| 109 | shutdownReason string |
| 110 | |
| 111 | healthThreshold int |
| 112 | health healthMonitor |
| 113 | processRecord *toolruntime.Handle |
| 114 | } |
| 115 | |
| 116 | type launchRuntimeConfig struct { |
| 117 | logger *slog.Logger |
nothing calls this directly
no outgoing calls
no test coverage detected