Module: Patriot::JobStore::JobState

Defined in:
lib/patriot/job_store.rb

Overview

state of jobs in JobStore

Constant Summary collapse

DISCARDED =

unneeded and discarded (i.e, trash)

-2
# initiating
INIT =

initiating

-1
# successfully finished
SUCCEEDED =

successfully finished

0
WAIT =

waiting to be executed

1
RUNNING =

running currently

2
SUSPEND =

suspended and not to be executed

3
FAILED =

executed but failed

4

Class Method Summary collapse

Class Method Details

.name_of(state) ⇒ Object

get name of the state @return

Parameters:



24
25
26
27
28
29
30
31
32
33
34
35
36
# 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