queue

package
v0.0.0-...-a2946bf Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler func(item repository.QueueJob) error

Handler 队列消息处理器

type Info

type Info struct {
	StartAt        time.Time `json:"start_at"`
	WorkerNum      int       `json:"worker_num"`
	ProcessedCount int64     `json:"processed_count"`
	FailedCount    int64     `json:"failed_count"`
}

Info 队列状态信息

type Manager

type Manager interface {
	Enqueue(item repository.QueueJob) (string, error)
	StartWorker(ctx context.Context, workerID string)
	Pause(pause bool)
	Paused() bool
	Info() Info
	RegisterHandler(name string, handler Handler)
}

Manager 队列管理接口

func NewManager

func NewManager(cc infra.Resolver) Manager

NewManager create a QueueManager

type Provider

type Provider struct{}

func (Provider) Boot

func (s Provider) Boot(app infra.Resolver)

func (Provider) Daemon

func (s Provider) Daemon(ctx context.Context, app infra.Resolver)

func (Provider) Register

func (s Provider) Register(app infra.Binder)

Jump to

Keyboard shortcuts

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