Documentation ¶
Overview ¶
Package pubsub *
- @Author: W.w.
- @File: pubsub
- @Date: 2023-06-01 17:01
- @Description:
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Publisher ¶
Publisher *****************************************************
- @Description: 发布者对象 *****************************************************
func NewPublisher ¶
NewPublisher *****************************************************
- @Description: 构建一个发布者对象, 可以设置发布超时时间和缓存队列的长度
- @param publishTimeout
- @param buffer
- @return *Publisher *****************************************************
func (*Publisher) Close ¶
func (p *Publisher) Close()
Close *****************************************************
- @Description: 关闭发布者对象,同时关闭所有的订阅者管道。
- @receiver p *****************************************************
func (*Publisher) Publish ¶
Publish *****************************************************
- @Description: 发布一个消息
- @receiver p
- @param v *****************************************************
func (*Publisher) Subscribe ¶
Subscribe *****************************************************
- @Description: 添加一个新的订阅者,订阅全部主题
- @receiver p
- @return chan any *****************************************************
func (*Publisher) SubscribeTopic ¶
SubscribeTopic *****************************************************
- @Description: 添加一个新的订阅者,订阅过滤器筛选后的主题
- @receiver p
- @param topic
- @return chan any *****************************************************
func (*Publisher) Unsubscribe ¶
Unsubscribe *****************************************************
- @Description: 取消订阅
- @receiver p
- @param sub *****************************************************
Click to show internal directories.
Click to hide internal directories.