xqueuensq

package
v0.3.54 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: BSD-3-Clause-Clear Imports: 4 Imported by: 0

Documentation

Overview

NSQ驱动xqueue队列

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(get, gettopic, getchannel, set, settopic string, max_error uint16) xqueue.Queue

获取完整的NSQ的xqueue驱动

get			监听队列端口 一般为127.0.0.1:4161
gettopic	监听队列的通道
getchannel	监听队列的客户端
set			发送队列的端口 一般为127.0.0.1:4150
settopic	发送队列的通道
max_error	最大错误重试次数

func OpenGet added in v0.3.29

func OpenGet(get, gettopic, getchannel string, max_error uint16) xqueue.Queue

获取仅监听NSQ的xqueue驱动

get			监听队列端口 一般为127.0.0.1:4161
gettopic	监听队列的通道
getchannel	监听队列的客户端
max_error	最大错误重试次数

func OpenSet added in v0.3.29

func OpenSet(set, settopic string) xqueue.Queue

获取仅推送的Nsq配置的xqueue驱动

set			发送队列的端口 一般为127.0.0.1:4150
settopic	发送队列的通道

Types

type Queues

type Queues struct {
	// contains filtered or unexported fields
}

func (*Queues) HandleMessage

func (c *Queues) HandleMessage(m *nsq.Message) error

队列消息监听 此处使用 HandleMessage 作为NSQ的消息处理函数 调用位置: nsq.AddHandler

m	消息体

func (*Queues) Listen

func (c *Queues) Listen(f func(dat []byte) error) error

队列监听

func (*Queues) Set

func (c *Queues) Set(dat []byte) error

设置队列监听

func (*Queues) SetDef

func (c *Queues) SetDef(dat []byte, t time.Duration) error

设置延时队列监听

Jump to

Keyboard shortcuts

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