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
Click to show internal directories.
Click to hide internal directories.