1 Star 0 Fork 0

jack/protoactor-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
identity_storage_worker.go 928 Bytes
一键复制 编辑 原始数据 按行查看 历史
490689386@qq.com 提交于 2025-05-19 14:50 +08:00 . 初始化
package cluster
import (
"log"
"gitee.com/wujianhai/protoactor-go/actor"
)
type IdentityStorageWorker struct {
cluster *Cluster
lookup *IdentityStorageLookup
storage StorageLookup
}
func newIdentityStorageWorker(storageLookup *IdentityStorageLookup) *IdentityStorageWorker {
this := &IdentityStorageWorker{
cluster: storageLookup.cluster,
lookup: storageLookup,
storage: storageLookup.Storage,
}
return this
}
// Receive func
func (ids *IdentityStorageWorker) Receive(c actor.Context) {
m := c.Message()
getPid, ok := m.(GetPid)
if !ok {
return
}
if c.Sender() == nil {
log.Println("No sender in GetPid request")
return
}
existing, _ := ids.cluster.PidCache.Get(getPid.ClusterIdentity.Identity, getPid.ClusterIdentity.Kind)
if existing != nil {
log.Printf("Found %s in pidcache", m.(GetPid).ClusterIdentity.ToShortString())
c.Respond(newPidResult(existing))
}
return
// continue
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wujianhai/protoactor-go.git
git@gitee.com:wujianhai/protoactor-go.git
wujianhai
protoactor-go
protoactor-go
5633fe2499dd

搜索帮助