share

package
v0.0.0-...-3596c24 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: MIT Imports: 9 Imported by: 0

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 共享订阅 没有 保留消息

Jump to

Keyboard shortcuts

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