consumer

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer interface {
	Pattern() string
	ProcessTask(ctx context.Context, t *asynq.Task) error
}

func New

func New[T interface{}](pattern string, handler Handler[T]) Consumer

type Handler

type Handler[T interface{}] interface {
	Handle(ctx context.Context, payload T) error
}

type HandlerFunc

type HandlerFunc[T interface{}] func(ctx context.Context, payload T) error

func (HandlerFunc[T]) Handle

func (f HandlerFunc[T]) Handle(ctx context.Context, payload T) error

type Unmarshaler

type Unmarshaler[T interface{}] interface {
	Unmarshal(t *asynq.Task) (T, error)
}

func NewJsonUnmarshaler

func NewJsonUnmarshaler[T interface{}]() Unmarshaler[T]

Jump to

Keyboard shortcuts

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