Documentation ¶
Index ¶
- func Init()
- func Publish(tag string, data map[string]interface{})
- func PublishTopic(topic string, tag string, data map[string]interface{})
- func SendEvent(appId string, uid string, event string, v interface{})
- func SendTagEvent(tag string, appId string, uid string, event string, v interface{})
- type MessageCallback
- type PubSub
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PublishTopic ¶
Types ¶
type MessageCallback ¶ added in v0.0.9
type PubSub ¶ added in v0.0.9
type PubSub struct {
// contains filtered or unexported fields
}
func (*PubSub) Publish ¶ added in v0.0.9
Publish a message to the topic Notice: this function is synchronous, so it will block until the message is published the caller should call this function in a goroutine
func (*PubSub) PullMessage ¶ added in v0.0.9
func (p *PubSub) PullMessage(callback MessageCallback, timeout time.Duration) error
PullMessage will pull a message from the topic using synchronous method, so it will block until a message is pulled if callback function returns error, the message will not be consumed and will be pulled again callback 业务完成以后, 返回nil, 否则返回错误 一旦返回错误,在一段时间之内,消息会继续被重新推送 如果超过时间,还没有成功, 则消息会进入死信队列
Click to show internal directories.
Click to hide internal directories.