mirror of
https://github.com/Fishwaldo/sched.git
synced 2025-03-15 11:31:29 +00:00
30 lines
548 B
Go
30 lines
548 B
Go
package job
|
|
|
|
//State Indicate the state of the Job
|
|
type State int64
|
|
|
|
const (
|
|
// NEW Job has just been created and hasn't started yet
|
|
NEW State = iota
|
|
// RUNNING Job started and is running.
|
|
RUNNING
|
|
// FINISHED Job started and finished processing.
|
|
FINISHED
|
|
// PANICKED Job started and finished but encountered a panic.
|
|
PANICKED
|
|
)
|
|
|
|
func (s State) String() string {
|
|
switch s {
|
|
case NEW:
|
|
return "NEW"
|
|
case RUNNING:
|
|
return "RUNNING"
|
|
case FINISHED:
|
|
return "FINISHED"
|
|
case PANICKED:
|
|
return "PANICKED"
|
|
default:
|
|
return "UNKNOWN"
|
|
}
|
|
}
|