consummer

package
v0.0.0-...-38d955b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DQConsumerClientId = "delayQueue-consumer"

Variables

View Source
var DelayResetErr = errors.New("Delayed resetting session. ")

DelayResetErr Delay, reset session

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController(name string, addr []string, delayTime []time.Duration, options ...Options) (*Controller, error)

NewController Create a controller

func (*Controller) Close

func (c *Controller) Close() bool

Close safety shutdown

func (*Controller) Log

func (c *Controller) Log(layout string, data ...interface{})

Log Controller Logs

func (*Controller) Run

func (c *Controller) Run(ctx context.Context) error

Run Start consuming delayed tasks

type Options

type Options func(*Controller)

func WithLogger

func WithLogger(logger logger.Logger) Options

WithLogger Setting the Log Interface

func WithTimezone

func WithTimezone(timezone string) Options

WithTimezone Set the timezone

type Processor

type Processor struct {
	// contains filtered or unexported fields
}

Processor processor

func NewProcessor

func NewProcessor(adds []string, name string, delayTime time.Duration, log logger.Logger) (*Processor, error)

NewProcessor create a Processor

func (*Processor) Cleanup

func (*Processor) ConsumeClaim

func (h *Processor) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error

func (*Processor) Log

func (h *Processor) Log(layout string, data ...interface{})

Log Processor Logs

func (*Processor) Run

func (h *Processor) Run(ctx context.Context, wg *sync.WaitGroup)

Run Processor start Repeat startup is not allowed.

func (*Processor) Setup

func (h *Processor) Setup(session sarama.ConsumerGroupSession) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL