741fdcee24
Process spawn/wait/kill functions for subprocess management with output capture, timeout, and process group cleanup. DagRun and DagStepResult types for SQLite execution persistence. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
27 lines
465 B
Go
27 lines
465 B
Go
package infra
|
|
|
|
import (
|
|
"bytes"
|
|
"os/exec"
|
|
"time"
|
|
)
|
|
|
|
// ProcessHandle represents a running subprocess with output buffers.
|
|
type ProcessHandle struct {
|
|
Cmd *exec.Cmd
|
|
Pid int
|
|
StartTime time.Time
|
|
Dir string
|
|
stdout *bytes.Buffer
|
|
stderr *bytes.Buffer
|
|
}
|
|
|
|
// ProcessResult contains the outcome of a completed subprocess.
|
|
type ProcessResult struct {
|
|
ExitCode int
|
|
Stdout string
|
|
Stderr string
|
|
DurationMs int64
|
|
Killed bool
|
|
}
|