module HydroponicBean::Commands::Other

Public Instance Methods

kick_job(stream, id) click to toggle source
# File lib/hydroponic_bean/commands/other.rb, line 32
def kick_job(stream, id)
  for_job(id) do |job|
    if job.kick
      output("KICKED\r\n")
    end
  end
end
peek(stream, id = nil) click to toggle source
# File lib/hydroponic_bean/commands/other.rb, line 4
def peek(stream, id = nil)
  for_job(id) do |job|
    peek_output(job)
  end
end
peek_buried(stream) click to toggle source
# File lib/hydroponic_bean/commands/other.rb, line 15
def peek_buried(stream)
  peek_output current_tube.buried_jobs.first
end
peek_delayed(stream) click to toggle source
# File lib/hydroponic_bean/commands/other.rb, line 19
def peek_delayed(stream)
  HydroponicBean.update_time!
  peek_output current_tube.delayed_jobs.first
end
peek_ready(stream) click to toggle source
# File lib/hydroponic_bean/commands/other.rb, line 10
def peek_ready(stream)
  HydroponicBean.update_time!
  peek_output current_tube.ready_jobs.first
end
stats_job(stream, id) click to toggle source
# File lib/hydroponic_bean/commands/other.rb, line 24
def stats_job(stream, id)
  for_job(id) do |job|
    stats = job.serialize_stats.to_yaml
    output("OK #{stats.length}\r\n")
    output("#{stats}\r\n")
  end
end

Protected Instance Methods

peek_output(job) click to toggle source
# File lib/hydroponic_bean/commands/other.rb, line 41
def peek_output(job)
  if job
    output("FOUND #{job.id} #{job.data.length}\r\n")
    output("#{job.data}\r\n")
  else
    output(Protocol::NOT_FOUND)
    return false
  end
end