Scala 为什么Akka演员不接收子频道?
我有一个AkkaScala 为什么Akka演员不接收子频道?,scala,akka,Scala,Akka,我有一个AkkaActorEventBus(参考),它处理大量传递给不同参与者的消息 我已经安排了一名演员订阅这辆巴士: /** * special actor that transports messages to the hive */ val hiveTalk = { val subscriber = actorSystem.actorOf(Props(new HiveTransport)) Bus.subscribe( subscriber, "/app
ActorEventBus
(参考),它处理大量传递给不同参与者的消息
我已经安排了一名演员订阅这辆巴士:
/**
* special actor that transports messages to the hive
*/
val hiveTalk = {
val subscriber = actorSystem.actorOf(Props(new HiveTransport))
Bus.subscribe( subscriber, "/app/browser/" )
Bus.subscribe( subscriber, "/app/mobile/" )
}
MessageBus
类是ActorEventBus
的实现,如下所示:
/**
* message bus to route messages to their appropriate contexts
*/
class MessageBus extends ActorEventBus with LookupClassification {
type Event = MessageEvent
type Classifier = String
protected def mapSize(): Int = {
10
}
protected def classify(event: Event): Classifier = {
event.channel
}
protected def publish(event: Event, subscriber: Subscriber): Unit = {
subscriber ! event
}
}
问题
由于某些原因,hiveTalk
参与者订户无法接收发送到类似于/app/browser/26
的子频道的消息
知道为什么吗?解决了。显然,查找分类实际上只是简单的单通道实现
子信道分类
是Akka特性,旨在实际实现子信道