Skip to content

Commit

Permalink
jobs/v1: Add kafka related fields to the interface
Browse files Browse the repository at this point in the history
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
  • Loading branch information
rustatian committed Jan 16, 2023
1 parent 5932b48 commit 2ea3ace
Showing 1 changed file with 6 additions and 23 deletions.
29 changes: 6 additions & 23 deletions plugins/v1/jobs/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"

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

// constant keys to pack/unpack messages from different drivers
Expand Down Expand Up @@ -38,24 +37,6 @@ type State struct {
Priority uint64
}

type Configurer interface {
// UnmarshalKey takes a single key and unmarshals it into a Struct.
UnmarshalKey(name string, out any) error

// Has checks if config section exists.
Has(name string) bool
}

type Logger interface {
Debug(msg string, fields ...zap.Field)
Warn(msg string, fields ...zap.Field)
Error(msg string, fields ...zap.Field)
Info(msg string, fields ...zap.Field)
DPanic(msg string, fields ...zap.Field)
Panic(msg string, fields ...zap.Field)
Fatal(msg string, fields ...zap.Field)
}

type Job interface {
Name() string
ID() string
Expand All @@ -67,7 +48,12 @@ type Job interface {
Delay() int64
AutoAck() bool

SetPriority(int64)
Offset() int64
Partition() int32
Topic() string
Metadata() string

UpdatePriority(int64)
}

type Pipeline interface {
Expand Down Expand Up @@ -112,13 +98,10 @@ type Consumer interface {
type Acknowledger interface {
// Ack - acknowledge the Item after processing
Ack() error

// Nack - discard the Item
Nack() error

// Requeue - put the message back to the queue with the optional delay
Requeue(headers map[string][]string, delay int64) error

// Respond to the queue
Respond(payload []byte, queue string) error
}
Expand Down

0 comments on commit 2ea3ace

Please sign in to comment.