cache

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoKey     = errs.NewErrKeyNotFound("没有key")
	ErrNoMessage = errors.New("没有消息")
)

Functions

This section is empty.

Types

type LocalCache

type LocalCache interface {
	// RPush 并发队列 生产者用
	RPush(ctx context.Context, msg domain.Message)
	LPop(ctx context.Context, biz string) (domain.Message, error)
	// BRPush 并发阻塞队列 多个消费者一起用
	BRPush(ctx context.Context, msg domain.Message) error
	BLPop(ctx context.Context, biz string) (domain.Message, error)
	Delete(key string)
	// LPopAll 出队消费者队列的所有元素,在cancel写回存储介质的时候用
	LPopAll(ctx context.Context, biz string) ([]domain.Message, error)
}

func NewLocalCache

func NewLocalCache() LocalCache

Jump to

Keyboard shortcuts

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