class

Bootstrap::ProcessRunner

Inherits Reference < Object

Run processes with throttled output to reduce IO overhead during builds. When attached to a TTY, only the last few lines are rendered at a controlled rate to avoid scrolling.

Constants

DEFAULT_FLUSH_INTERVAL = 0.5.seconds

Flush output at most 2 times per second. Source: build output throttling requirement (2 Hz).

DEFAULT_SPINNER_INTERVAL = 0.2.seconds

Refresh the spinner at 5 Hz to balance responsiveness with IO overhead. Source: human-visible feedback cadence for long-running tasks.

SPINNER_FRAMES = ["-", "\\", "|", "/"]

ASCII spinner frames to ensure compatibility with minimal terminals.

TTY_IOCTL_GET_WINSIZE = 21523_u64

Linux TIOCGWINSZ ioctl request value from /usr/include/asm-generic/ioctls.h.

Class methods

run(argv : Array(String), env : Hash(String, String) = {} of String => String, input : IO = STDIN, stdout : IO = STDOUT, stderr : IO = STDERR, flush_interval : Time::Span = DEFAULT_FLUSH_INTERVAL, capture_path : String | Nil = nil, capture_on_error : Bool = false) : Result

Run argv with throttled stdout/stderr, returning status + elapsed time.

Source
run_fibered(label : String, stdout : IO = STDOUT, stderr : IO = STDERR, spinner_interval : Time::Span = DEFAULT_SPINNER_INTERVAL, &) : Time::Span

Run a long-lived block with a fiber-driven spinner and return the elapsed time.

Source

Nested types