Documentation ¶
Overview ¶
共享订阅
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMemProvider ¶
func NewMemProvider() *memTopics
NewMemProvider 返回memTopics的一个新实例,该实例实现了 TopicsProvider接口。memProvider是存储主题的隐藏结构 订阅并保留内存中的消息。内容不是这样持久化的 当服务器关闭时,所有东西都将消失。小心使用。
Types ¶
type TopicProvider ¶
type TopicProvider interface { Subscribe(shareName []byte, sub topic.Sub, subscriber interface{}) (byte, error) Unsubscribe(topic, shareName []byte, subscriber interface{}) error Subscribers(topic, shareName []byte, qos byte, subs *[]interface{}, qoss *[]topic.Sub) error AllSubInfo() (map[string][]string, error) // 获取所有的共享订阅,k: 主题,v: 该主题的所有共享组 Retain(msg *message.PublishMessage, shareName []byte) error Retained(topic, shareName []byte, msgs *[]*message.PublishMessage) error Close() error }
TopicProvider 共享订阅 没有 保留消息
Click to show internal directories.
Click to hide internal directories.