subscribe

package
v0.0.0-...-efd88b5 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventCleanAppMemCache = "clean:app:memory:cache" // 清理各pod本地App相关内存缓存
)

定义redis pub-sub订阅消息事件常量<本质就是redis订阅推送过来的消息本身>

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisSubscribe

type RedisSubscribe struct{}

RedisSubscribe redis 发布-订阅功能实现的多pod间触发执行一些同步逻辑

  • 极端场景下redis pub-sub可靠性并不能百分百保障订阅者取得每一份消息
  • <ugly-极端场景发生时业务已不可用订阅者是否还能收到消息还重要?>
  • go-redis 本身已内部实现断线自动重连 https://redis.uptrace.dev/#pubsub

func New

func New() *RedisSubscribe

New 实例化redis订阅同步实例

func (RedisSubscribe) Start

func (rs RedisSubscribe) Start()

Start 启动redis发布-订阅监听<内部协程方式>

Jump to

Keyboard shortcuts

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