xmsg

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultMode = "300,500,1000,3000,5000"

DefaultMode 失败重试的休眠策略

View Source
var MaxMode = "1000,3000,5000,10000,30000,60000,300000,600000,3600000"
View Source
var MidMode = "500,1000,3000,5000,10000,30000"
View Source
var MinMode = "300"

Functions

This section is empty.

Types

type Msg

type Msg struct {
	ID       string      // 消息ID
	Val      interface{} // 消息值
	Topic    string      // 消息主题
	Count    int         // 计数
	MaxCount int         // 最大重试次数
	Tactics  string      // 休眠策略,如"100,300,500" 第一次是100ms,第二次是300ms,第三次是500ms
}

Msg 通知消息对应的结构体

func NewMsg

func NewMsg(topic string, val interface{}) Msg

NewMsg 创建管道消息实例

func NewMsgWithTactics added in v0.1.8

func NewMsgWithTactics(topic string, val interface{}, tactics string) Msg

NewMsgWithTactics 创建消息实例并设置休眠策略

func (Msg) SetMaxCount

func (that Msg) SetMaxCount(max int) Msg

SetMaxCount 设置消息的最大重试次数

func (Msg) SetTactics

func (that Msg) SetTactics(tactics string) Msg

SetTactics 设置消息梯级休眠策略,如"100,300,500" 第一次是100ms,第二次是300ms,第三次是500ms

Jump to

Keyboard shortcuts

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