4
4
"context"
5
5
6
6
"github.com/roadrunner-server/api/v3/plugins/v1/priority_queue"
7
- "go.uber.org/zap"
8
7
)
9
8
10
9
// constant keys to pack/unpack messages from different drivers
@@ -38,24 +37,6 @@ type State struct {
38
37
Priority uint64
39
38
}
40
39
41
- type Configurer interface {
42
- // UnmarshalKey takes a single key and unmarshals it into a Struct.
43
- UnmarshalKey (name string , out any ) error
44
-
45
- // Has checks if config section exists.
46
- Has (name string ) bool
47
- }
48
-
49
- type Logger interface {
50
- Debug (msg string , fields ... zap.Field )
51
- Warn (msg string , fields ... zap.Field )
52
- Error (msg string , fields ... zap.Field )
53
- Info (msg string , fields ... zap.Field )
54
- DPanic (msg string , fields ... zap.Field )
55
- Panic (msg string , fields ... zap.Field )
56
- Fatal (msg string , fields ... zap.Field )
57
- }
58
-
59
40
type Job interface {
60
41
Name () string
61
42
ID () string
@@ -67,7 +48,12 @@ type Job interface {
67
48
Delay () int64
68
49
AutoAck () bool
69
50
70
- SetPriority (int64 )
51
+ Offset () int64
52
+ Partition () int32
53
+ Topic () string
54
+ Metadata () string
55
+
56
+ UpdatePriority (int64 )
71
57
}
72
58
73
59
type Pipeline interface {
@@ -112,13 +98,10 @@ type Consumer interface {
112
98
type Acknowledger interface {
113
99
// Ack - acknowledge the Item after processing
114
100
Ack () error
115
-
116
101
// Nack - discard the Item
117
102
Nack () error
118
-
119
103
// Requeue - put the message back to the queue with the optional delay
120
104
Requeue (headers map [string ][]string , delay int64 ) error
121
-
122
105
// Respond to the queue
123
106
Respond (payload []byte , queue string ) error
124
107
}
0 commit comments