1 Star 0 Fork 0

jack/protoactor-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
gossip.go 1.49 KB
一键复制 编辑 原始数据 按行查看 历史
490689386@qq.com 提交于 2025-05-19 14:50 +08:00 . 初始化
// Copyright (C) 2017 - 2024 Asynkton AB All rights reserved
package cluster
import (
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/anypb"
)
// customary type that defines a states sender callback.
type LocalStateSender func(memberStateDelta *MemberStateDelta, member *Member)
// This interface must be implemented by any value that.
// wants to be used as a gossip state storage
type GossipStateStorer interface {
GetState(key string) map[string]*GossipKeyValue
SetState(key string, value proto.Message)
SetMapState(stateKey string, mapKey string, value proto.Message)
RemoveMapState(stateKey string, mapKey string)
GetMapKeys(stateKey string) []string
GetMapState(stateKey string, mapKey string) *anypb.Any
}
// This interface must be implemented by any value that
// wants to add or remove consensus checkers
type GossipConsensusChecker interface {
AddConsensusCheck(id string, check *ConsensusCheck)
RemoveConsensusCheck(id string)
}
// This interface must be implemented by any value that
// wants to react to cluster topology events
type GossipCore interface {
UpdateClusterTopology(topology *ClusterTopology)
ReceiveState(remoteState *GossipState) []*GossipUpdate
SendState(sendStateToMember LocalStateSender)
GetMemberStateDelta(targetMemberID string) *MemberStateDelta
}
// The Gossip interface must be implemented by any value
// that pretends to participate with-in the Gossip protocol
type Gossip interface {
GossipStateStorer
GossipConsensusChecker
GossipCore
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wujianhai/protoactor-go.git
git@gitee.com:wujianhai/protoactor-go.git
wujianhai
protoactor-go
protoactor-go
5633fe2499dd

搜索帮助