Skip to content

Commit 2ea3ace

Browse files
committed
jobs/v1: Add kafka related fields to the interface
Signed-off-by: Valery Piashchynski <[email protected]>
1 parent 5932b48 commit 2ea3ace

File tree

1 file changed

+6
-23
lines changed

1 file changed

+6
-23
lines changed

plugins/v1/jobs/interface.go

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55

66
"github.com/roadrunner-server/api/v3/plugins/v1/priority_queue"
7-
"go.uber.org/zap"
87
)
98

109
// constant keys to pack/unpack messages from different drivers
@@ -38,24 +37,6 @@ type State struct {
3837
Priority uint64
3938
}
4039

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-
5940
type Job interface {
6041
Name() string
6142
ID() string
@@ -67,7 +48,12 @@ type Job interface {
6748
Delay() int64
6849
AutoAck() bool
6950

70-
SetPriority(int64)
51+
Offset() int64
52+
Partition() int32
53+
Topic() string
54+
Metadata() string
55+
56+
UpdatePriority(int64)
7157
}
7258

7359
type Pipeline interface {
@@ -112,13 +98,10 @@ type Consumer interface {
11298
type Acknowledger interface {
11399
// Ack - acknowledge the Item after processing
114100
Ack() error
115-
116101
// Nack - discard the Item
117102
Nack() error
118-
119103
// Requeue - put the message back to the queue with the optional delay
120104
Requeue(headers map[string][]string, delay int64) error
121-
122105
// Respond to the queue
123106
Respond(payload []byte, queue string) error
124107
}

0 commit comments

Comments
 (0)