module Patriot::JobStore::JobState

state of jobs in JobStore

Constants

DISCARDED

unneeded and discarded (i.e, trash)

FAILED

executed but failed

INIT

initiating

RUNNING

running currently

SUCCEEDED

successfully finished

SUSPEND

suspended and not to be executed

WAIT

waiting to be executed

Public Class Methods

name_of(state) click to toggle source

get name of the state @param [Patriot::JobStore::JobState] state @return

# File lib/patriot/job_store.rb, line 24
def name_of(state)
  state = state.to_i
  return case state
    when -2 then "DISCARDED"
    when -1 then "INIT"
    when 0  then "SUCCEEDED"
    when 1  then "WAIT"
    when 2  then "RUNNING"
    when 3  then "SUSPEND"
    when 4  then "FAILED"
    else raise "unknown state #{state}"
  end
end

Private Instance Methods

name_of(state) click to toggle source

get name of the state @param [Patriot::JobStore::JobState] state @return

# File lib/patriot/job_store.rb, line 24
def name_of(state)
  state = state.to_i
  return case state
    when -2 then "DISCARDED"
    when -1 then "INIT"
    when 0  then "SUCCEEDED"
    when 1  then "WAIT"
    when 2  then "RUNNING"
    when 3  then "SUSPEND"
    when 4  then "FAILED"
    else raise "unknown state #{state}"
  end
end