class LittleGhost::Support::InterruptibleStream

InterruptibleStream turns a blocking producer into a lazy, cancellable Ruby stream. It is useful when an SDK owns the blocking read but the agent still needs deadlines and cooperative cancellation.

The producer receives an emitter callable. Ending enumeration early stops and joins the producer; CleanupError is raised if it cannot be stopped within the fixed shutdown bound.

stream = LittleGhost::Support::InterruptibleStream.new(
  cancellation_token: token
) { |emit| source.each { |value| emit.call(value) } }