worker

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackgroundEnqueuer

type BackgroundEnqueuer interface {
	Enqueue(pattern string, task []byte, opts ...EnqueuerOption) error
	EnqueueContext(ctx context.Context, pattern string, task []byte, opts ...EnqueuerOption) error
	Close() error
}

func NewBackgroundEnqueuer

func NewBackgroundEnqueuer(config *config.WorkerConfig) BackgroundEnqueuer

type BackgroundWorker

type BackgroundWorker interface {
	Register(pattern string, handler func(ctx context.Context, payload []byte) error, cleanups ...func(taskID string, payload []byte))
	Run()
}

func NewBackgroundWorker

func NewBackgroundWorker(config *config.WorkerConfig, logger log.Logger) BackgroundWorker

type EnqueuerOption

type EnqueuerOption func(*EnqueuerOptions)

func WithMaxRetry

func WithMaxRetry(val int) EnqueuerOption

func WithTaskID

func WithTaskID(val string) EnqueuerOption

func WithTimeout

func WithTimeout(val time.Duration) EnqueuerOption

type EnqueuerOptions

type EnqueuerOptions struct {
	TaskID   string
	MaxRetry int
	Timeout  time.Duration
}

func NewEnqueuerOptions

func NewEnqueuerOptions(opts ...EnqueuerOption) EnqueuerOptions

type WorkerRedisCredentials

type WorkerRedisCredentials struct {
	Addresses    []string
	Username     string
	Password     string
	Database     int
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
}

type WorkerType

type WorkerType int
var (
	Asynq WorkerType = 0
)

Jump to

Keyboard shortcuts

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