David K. Bainbridge | f0da873 | 2016-06-01 16:15:37 -0700 | [diff] [blame] | 1 | package main |
2 | |||||
3 | type TaskStatus uint8 | ||||
4 | |||||
5 | const ( | ||||
6 | Pending TaskStatus = iota | ||||
7 | Running | ||||
8 | Complete | ||||
9 | Failed | ||||
10 | ) | ||||
11 | |||||
12 | func (s TaskStatus) String() string { | ||||
13 | switch s { | ||||
14 | case Pending: | ||||
15 | return "PENDING" | ||||
16 | case Running: | ||||
17 | return "RUNNING" | ||||
18 | case Complete: | ||||
19 | return "COMPLETE" | ||||
20 | case Failed: | ||||
21 | return "FAILED" | ||||
22 | } | ||||
23 | return "INVALID TASK STATUS" | ||||
24 | } | ||||
25 | |||||
26 | type Task struct { | ||||
27 | nodeId string | ||||
28 | status TaskStatus | ||||
29 | } | ||||
30 | |||||
31 | type TaskQueueEntry struct { | ||||
32 | previous *TaskQueueEntry | ||||
33 | next *TaskQueueEntry | ||||
34 | task *Task | ||||
35 | } | ||||
36 | |||||
37 | type TaskQueue struct { | ||||
38 | } |