-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjob.go
53 lines (48 loc) · 1.27 KB
/
job.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
package workq
// FgJob is executed by the "run" command.
// Describes a foreground job specification.
type FgJob struct {
ID string
Name string
TTR int
Timeout int // Milliseconds to wait for job completion.
Payload []byte
Priority int // Numeric priority
}
// BgJob is executed by the "add" command.
// Describes a background job specification.
type BgJob struct {
ID string
Name string
TTR int // Time-to-run
TTL int // Time-to-live
Payload []byte
Priority int // Numeric priority
MaxAttempts int // Absoulute max num of attempts.
MaxFails int // Absolute max number of failures.
}
// ScheduledJob is executed by the "schedule" command.
// Describes a scheduled job specification.
type ScheduledJob struct {
ID string
Name string
TTR int
TTL int
Payload []byte
Time string
Priority int // Numeric priority
MaxAttempts int // Absoulute max num of attempts.
MaxFails int // Absolute max number of failures.
}
// LeasedJob is returned by the "lease" command.
type LeasedJob struct {
ID string
Name string
TTR int
Payload []byte
}
// JobResult is returned by the "run" & "result" commands.
type JobResult struct {
Success bool
Result []byte
}