Documentation ¶
Overview ¶
示例 https://github.com/nsqio/nsq/tree/master/apps
必须先调用InitProducer初始化生产者
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Producer *nsq.Producer
Producer will lazily connect to that instance (and re-connect) when Publish commands are executed.
Functions ¶
Types ¶
type Handler ¶
type Handler func(*nsq.Message) error
Handler 实现 nsq.Handler 接口
func (Handler) HandleMessage ¶
HandleMessage 处理消息 Returning nil will automatically send a FIN command to NSQ to mark the message as processed. Returning a non-nil error will automatically send a REQ command to NSQ to re-queue the message.
Click to show internal directories.
Click to hide internal directories.