class Riffer::Rig::Tools::Bash::Kill
Public Instance Methods
(context: Riffer::Agent::Context?, job_id: String) → Riffer::Tools::Response
Source
# File lib/riffer/rig/tools/bash/kill.rb, line 15 def call(context:, job_id:) jobs = context&.[](:jobs) #: Riffer::Rig::Runtime::Jobs? return error('no background job registry in the context', type: :command_failed) unless jobs job = jobs.kill(job_id) return error("No background job #{job_id}", type: :not_found) unless job text(job.completed? ? "Job #{job_id} has already exited" : "Sent TERM to job #{job_id}") end
@rbs context: Riffer::Agent::Context? @rbs job_id: String @rbs return: Riffer::Tools::Response