processgroup

package
v0.4.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package processgroup runs a subprocess with identity-safe leader and qualified descendant cleanup.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Dir         string
	Env         []string
	Stdin       io.Reader
	Stdout      io.Writer
	Stderr      io.Writer
	BeforeStart func() error
}

Options configures one supervised process without exposing os/exec mutation after startup.

type Process

type Process struct {
	// contains filtered or unexported fields
}

Process owns one subprocess and any descendants observed by the platform tracker.

func Start

func Start(executable string, args []string, options Options) (*Process, error)

Start launches executable as the leader of a new process group.

func (*Process) PID

func (process *Process) PID() int

PID returns the process-group leader identifier.

func (*Process) Terminate

func (process *Process) Terminate(ctx context.Context) error

Terminate stops the retained leader identity and every qualified observed descendant before the cleanup budget expires.

func (*Process) Wait

func (process *Process) Wait(ctx context.Context) error

Wait waits for the process-group leader or the caller's context.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL