Documentation
¶
Index ¶
- type IPub
- type ISub
- type IUnsub
- type SubFunc
- type SubTopicItem
- type Subscribe
- func (this *Subscribe) Close() error
- func (this *Subscribe) Count() int
- func (this *Subscribe) GetTopicSubCount(topic string) int
- func (this *Subscribe) Pub(topic string, max int, args ...interface{}) int
- func (this *Subscribe) Status() string
- func (this *Subscribe) StatusDetail() string
- func (this *Subscribe) Sub(id, topic string, cb func(id, topic string, args ...interface{}) (ok bool))
- func (this *Subscribe) TopicCount() int
- func (this *Subscribe) Unsub(id, topic string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SubTopicItem ¶
type SubTopicItem struct {
// contains filtered or unexported fields
}
type Subscribe ¶
type Subscribe struct {
// contains filtered or unexported fields
}
订阅中心,
func NewSubscribe ¶
func NewSubscribe() *Subscribe
func NewSubscribeEx ¶
func (*Subscribe) GetTopicSubCount ¶
func (*Subscribe) Pub ¶
max:0, 全部投递 >1 投递成功max次后停止 循环map
utils_subscribe_v2._test.go:168: 34228, 6844/s utils_subscribe_v2._test.go:168: 68952, 6894/s
循环lst
utils_subscribe_v2._test.go:168: 35343, 6977/s utils_subscribe_v2._test.go:168: 71194, 7072/s
向主题订阅者推送数据 topic推送的主题 max最大接收者,超过该值不再进行推送
func (*Subscribe) StatusDetail ¶
func (*Subscribe) Sub ¶
func (this *Subscribe) Sub(id, topic string, cb func(id, topic string, args ...interface{}) (ok bool))
订阅一个主题
topic订阅主题,为空不进行订阅 id订阅者id,topic 下id重复将会被覆盖(之前订阅失效)
func (*Subscribe) TopicCount ¶
Click to show internal directories.
Click to hide internal directories.