-
Notifications
You must be signed in to change notification settings - Fork 0
/
events.go
69 lines (66 loc) · 2.25 KB
/
events.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package events
type EventType uint32
const (
// EventWorkerConstruct thrown when new worker is spawned.
EventWorkerConstruct EventType = iota
// EventWorkerDestruct thrown after worker destruction.
EventWorkerDestruct
// EventWorkerProcessExit triggered on process wait exit
EventWorkerProcessExit
// EventNoFreeWorkers triggered when there are no free workers in the stack and timeout for worker allocate elapsed
EventNoFreeWorkers
// EventMaxMemory caused when worker consumes more memory than allowed.
EventMaxMemory
// EventTTL thrown when worker is removed due TTL being reached. TTL defines maximum time worker is allowed to live (seconds)
EventTTL
// EventIdleTTL triggered when worker spends too much time at rest.
EventIdleTTL
// EventExecTTL triggered when worker spends too much time doing the task (max_execution_time).
EventExecTTL
// EventWorkerError triggered after WorkerProcess. Except payload to be error.
EventWorkerError
// EventWorkerSoftError triggered after processing payload. This is not the panic/exception, we should not restart the worker.
EventWorkerSoftError
// EventWorkerStderr is the worker standard error output
EventWorkerStderr
// EventWorkerWaitExit is the worker exit event
EventWorkerWaitExit
// EventWorkerStopped triggered when worker gracefully stopped
EventWorkerStopped
// EventJOBSDriverCommand triggered when drivers wants to send event to the jobs plugin
EventJOBSDriverCommand
)
func (et EventType) String() string {
switch et {
case EventWorkerProcessExit:
return "EventWorkerProcessExit"
case EventWorkerConstruct:
return "EventWorkerConstruct"
case EventWorkerDestruct:
return "EventWorkerDestruct"
case EventNoFreeWorkers:
return "EventNoFreeWorkers"
case EventMaxMemory:
return "EventMaxMemory"
case EventTTL:
return "EventTTL"
case EventIdleTTL:
return "EventIdleTTL"
case EventExecTTL:
return "EventExecTTL"
case EventWorkerError:
return "EventWorkerError"
case EventWorkerStderr:
return "EventWorkerStderr"
case EventWorkerWaitExit:
return "EventWorkerWaitExit"
case EventWorkerStopped:
return "EventWorkerStopped"
case EventWorkerSoftError:
return "EventWorkerSoftError"
case EventJOBSDriverCommand:
return "EventJOBSDriverCommand"
default:
return "UnknownEventType"
}
}