proc

package
v0.0.49 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0, MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package proc bounds the lifetime of the external processes draft starts.

Killing a process on timeout is not enough to end a call. A provider CLI can leave a background process behind, and that process inherits the CLI's stdout and stderr: Wait then waits for output that never closes, and a three-second timeout was seen still blocked after three minutes. So a bounded command runs in its own process group, cancellation kills the whole group, and WaitDelay caps how long Wait lingers for output once the process is gone.

Index

Constants

This section is empty.

Variables

View Source
var WaitDelay = 5 * time.Second

WaitDelay is how long Wait waits for a process's output to close once the process has exited or its context is done. A variable so tests can shorten it.

Functions

func Bound

func Bound(cmd *exec.Cmd)

Bound sets cmd up so that neither the process nor anything it starts can hold a call open past its context. Call it before Start.

func Detach added in v0.0.48

func Detach(cmd *exec.Cmd)

Detach puts cmd in a process group of its own, where the platform has them, without bounding it. It is for a process meant to outlive draft: a terminal delivers Ctrl-C to the whole foreground process group, so a child left in draft's group is interrupted along with it. Call it before Start.

func Kill

func Kill(cmd *exec.Cmd) error

Kill kills cmd's process and, where the platform allows, everything it started. It is a no-op for a command that never started.

Types

This section is empty.

Jump to

Keyboard shortcuts

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