redisstream

package
v2.0.0-...-fed3738 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StreamMaxLen = 10000           // stream最大长度
	BlockTime    = time.Minute     // 阻塞读取时间
	ErrWaitTime  = time.Second * 3 // 请求错误后的重试时间
)
View Source
const (
	RedisStreamPubName = "redis_stream"
)
View Source
const (
	RedisStreamSubName = "redis_stream"
)

Variables

This section is empty.

Functions

func Publish

func Publish(ctx context.Context, name, topic string, msg []byte) (msgID string, err error)

func RegisterHandler

func RegisterHandler(name, topic string, handler MsgHandler)

Types

type MsgHandler

type MsgHandler func(ctx context.Context, data []byte) error

Jump to

Keyboard shortcuts

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