1 Star 0 Fork 0

jack/protoactor-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
identity_lookup.go 1.64 KB
一键复制 编辑 原始数据 按行查看 历史
490689386@qq.com 提交于 2025-05-19 14:50 +08:00 . 初始化
package cluster
import (
"gitee.com/wujianhai/protoactor-go/actor"
)
// IdentityLookup contains
type IdentityLookup interface {
Get(clusterIdentity *ClusterIdentity) *actor.PID
RemovePid(clusterIdentity *ClusterIdentity, pid *actor.PID)
Setup(cluster *Cluster, kinds []string, isClient bool)
Shutdown()
}
// StorageLookup contains
type StorageLookup interface {
TryGetExistingActivation(clusterIdentity *ClusterIdentity) *StoredActivation
TryAcquireLock(clusterIdentity *ClusterIdentity) *SpawnLock
WaitForActivation(clusterIdentity *ClusterIdentity) *StoredActivation
RemoveLock(spawnLock SpawnLock)
StoreActivation(memberID string, spawnLock *SpawnLock, pid *actor.PID)
RemoveActivation(pid *SpawnLock)
RemoveMemberId(memberID string)
}
// SpawnLock contains
type SpawnLock struct {
LockID string
ClusterIdentity *ClusterIdentity
}
func newSpawnLock(lockID string, clusterIdentity *ClusterIdentity) *SpawnLock {
this := &SpawnLock{
LockID: lockID,
ClusterIdentity: clusterIdentity,
}
return this
}
// StoredActivation contains
type StoredActivation struct {
Pid string
MemberID string
}
func newStoredActivation(pid string, memberID string) *StoredActivation {
this := &StoredActivation{
Pid: pid,
MemberID: memberID,
}
return this
}
// GetPid contains
type GetPid struct {
ClusterIdentity *ClusterIdentity
}
func newGetPid(clusterIdentity *ClusterIdentity) *GetPid {
this := &GetPid{
ClusterIdentity: clusterIdentity,
}
return this
}
// PidResult contains
type PidResult struct {
Pid *actor.PID
}
func newPidResult(p *actor.PID) *PidResult {
this := &PidResult{
Pid: p,
}
return this
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wujianhai/protoactor-go.git
git@gitee.com:wujianhai/protoactor-go.git
wujianhai
protoactor-go
protoactor-go
5633fe2499dd

搜索帮助