proxy

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const LoadBalanceMethodLoop = "loop"
View Source
const WorkResponseSuccess = "200"

响应成功

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

func NewHandler

func NewHandler(consumeConfig model.ConsumeConfig) Handler

func (*Handler) HandleMessage

func (h *Handler) HandleMessage(message *nsq.Message) error

处理收到的订阅的消息 返回error就会重新入队,返回nil则不会

func (*Handler) LogFailedMessage

func (h *Handler) LogFailedMessage(message nsq.Message)

处理失败时会调用此方法 连续失败五次次,第六次时在go-nsq客户端giving up时会执行

type Proxy

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

func NewProxy

func NewProxy() *Proxy

生成一个新的Proxy实例 此方法建议全局只有一次调用

func (*Proxy) GetStop

func (p *Proxy) GetStop() int

func (*Proxy) IsStop

func (p *Proxy) IsStop() bool

func (*Proxy) Run

func (p *Proxy) Run()

开始运行NSQProxy

func (*Proxy) SetExitFlag

func (p *Proxy) SetExitFlag()

func (*Proxy) Stop

func (p *Proxy) Stop()

func (*Proxy) StopConsume

func (p *Proxy) StopConsume(consumeConfig *model.ConsumeConfig)

结束一个订阅

Jump to

Keyboard shortcuts

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