datamanager

package
v0.24.28 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataManagerMemory

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

func NewDataManagerMemory

func NewDataManagerMemory(serverTimeoutSec int) *DataManagerMemory

func (*DataManagerMemory) AddPub

func (d *DataManagerMemory) AddPub(streamName, serverId string)

func (*DataManagerMemory) DelPub

func (d *DataManagerMemory) DelPub(streamName, serverId string)

func (*DataManagerMemory) QueryPub

func (d *DataManagerMemory) QueryPub(streamName string) (serverId string, exist bool)

func (*DataManagerMemory) UpdatePub

func (d *DataManagerMemory) UpdatePub(serverId string, streamNameList []string)

type DataManagerType

type DataManagerType int
const (
	DmtMemory DataManagerType = iota
)

type DataManger

type DataManger interface {
	AddPub(streamName, serverId string)
	DelPub(streamName, serverId string)
	QueryPub(streamName string) (serverId string, exist bool)

	// 1. 全量校正。比如自身服务重启了,lal节点重启了,或其他原因Add、Del消息丢失了
	// 2. 心跳保活
	UpdatePub(serverId string, streamNameList []string)
}

func NewDataManager

func NewDataManager(t DataManagerType, serverTimeoutSec int) DataManger

erverTimeoutSec 超过该时间间隔没有Update,则清空对应节点的所有信息

Jump to

Keyboard shortcuts

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