queue

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IConsumeServer

type IConsumeServer interface {
	app.IApp
	IRegister
}

func NewServer

func NewServer(ctx context.Context) IConsumeServer

type IConsumer

type IConsumer interface {
	Consume(ctx context.Context) error
}

IConsumer 消费者约定

type IQueue

type IQueue interface {
	Push(ctx context.Context, value string) error
	Pop(ctx context.Context) (string, error)
}

IQueue 简单队列约定

func NewSimpleRedis

func NewSimpleRedis(cnf *RedisQueueConfig, name string) IQueue

NewSimpleRedis 创建简单的 Redis 队列

type IRegister

type IRegister interface {
	Register(consumer IConsumer)
	Count() uint
}

type RedisQueueConfig

type RedisQueueConfig struct {
	Addr     string
	Password string
	DB       int
	Timeout  time.Duration
}

RedisQueueConfig Redis 队列参数

Jump to

Keyboard shortcuts

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