blob: 497f0a06873c6260009bd46bd2ccd4060b8d652d (
plain)
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
|
package events
// EventWorkerKill thrown after WorkerProcess is being forcefully killed.
const (
// EventWorkerError triggered after WorkerProcess. Except payload to be error.
EventWorkerError E = iota + 200
// EventWorkerLog triggered on every write to WorkerProcess StdErr pipe (batched). Except payload to be []byte string.
EventWorkerLog
)
type E int64
func (ev E) String() string {
switch ev {
case EventWorkerError:
return "EventWorkerError"
case EventWorkerLog:
return "EventWorkerLog"
}
return "Unknown event type"
}
// WorkerEvent wraps worker events.
type WorkerEvent struct {
// Event id, see below.
Event E
// Worker triggered the event.
Worker interface{}
// Event specific payload.
Payload interface{}
}
|