mux

package module
v0.0.0-...-0a22e48 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

README

mux

多路复用器

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(replicas int, fn consistenthash.Hash) *consistenthash.Map

New 创建一个实例

func Process

func Process(procArr []string, channelLen int, timeoutSec int, m *consistenthash.Map, messaageHandler HandlerCallBack, message <-chan []byte, distributeKeyHandler GetdistributeKeyCallBack, timeoutHandler HandlerTimeoutCallBack) error

Process 数据处理,并发处理

Types

type Consumer

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

Consumer 消费者信息

type GetdistributeKeyCallBack

type GetdistributeKeyCallBack func(msg []byte) (key string, err error)

GetdistributeKeyCallBack 获取分发键值

type HandlerCallBack

type HandlerCallBack func(bucketName string, msg []byte)

HandlerCallBack 处理回调函数

type HandlerTimeoutCallBack

type HandlerTimeoutCallBack func()

HandlerTimeoutCallBack 数据处理超时回调函数,一般用于数据流监控, 监控数据是否产生出现了异常

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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