class

Smith::Tools::BashJob

Inherits Reference < Object

A shell command that outlives the tool call that started it.

Output goes to a file from the very first byte, never to a buffer. That is what makes auto-backgrounding seamless: a command that outruns its timeout is simply not waited on any longer — nothing is re-attached, re-run, or thrown away.

Constructors

new(id : String, command : String, log_path : String, process : Process)
Source

Instance methods

command
Source
exit_code
Source
kill(grace : Time::Span = 5.seconds) : Nil
Source
log_path
Source
read_new(filter : Regex | Nil = nil) : String

Only what has arrived since the last call. A tail -f job would otherwise push its whole log into the context on every read.

Source
running?
Source
runtime
Source
started_at
Source
status
Source
wait(span : Time::Span) : Bool

True when the job finished within the span.

Source
wait

Blocks until the job ends, however long that takes.

Deliberately not wait(Time::Span::MAX), which reads like the same thing: the event loop arms a timer at now + span, and that overflows. A deadline that cannot be represented is not a deadline — so this arms no timer at all.

Source

Nested types