- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试通过protobuf序列化/反序列化ActorRef。根据Akka的文档,唯一的方法是将ActorRef转换为String,然后将其转换回远程actor系统。
该文档提到使用ExtendedActorSystem
进行反序列化(请参阅here)。但是,尚不清楚如何获取ExtendedActorSystem
:
// Serialize
// (beneath toBinary)
val identifier: String = Serialization.serializedActorPath(theActorRef)
// Then just serialize the identifier however you like
// Deserialize
// (beneath fromBinary)
// ==== Where is this extendedSystem from? ====
val deserializedActorRef = extendedSystem.provider.resolveActorRef(identifier)
// Then just use the ActorRef
ActorSystem
转换为
ExtendedActorSystem
。这是正确的方法吗?会一直有效吗?
最佳答案
亲爱的@stackoverflower,
每当您使用ActorSystem(...)
时,它都会构建一个ActorSystemImpl
的实例。
类型树如下所示:ActorSystemImpl extends ExtendedActorSystem
和ExtendedActorSystem implements ActorSystem
您可以使用类似的语句val system: ExtendedActorSystem = ActorSystem(...).asInstanceOf[ExtendedActorSystem]
访问正确的类型自动完成功能。不幸的是,ActorSystemImpl
的作用域为[akka]
。
关于akka-cluster - Akka文档尚不清楚如何获取ExtendedActorSystem以反序列化ActorRef,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44875606/
我需要面对一个架构/设计决策。 我正在开发一个 Cordova/Meteor 应用程序,它具有独特的入门体验。新用户会看到一个向导,引导他们完成填写某些表单的步骤。 向导流程会等到最后一步才能注册用户
我想通过 psql 在空数据库中加载一些 SQL 函数: psql -d my_database -f fuctions.sql --set ON_ERROR_STOP=1 我使用 --set ON_
我是一名优秀的程序员,十分优秀!