我有一个具有默认配置的简单演员系统。
我有一个类扩展演员
class Test extend Actor {
def receive: Receive = {
case Foo(collection) => sender ! extract(collection)
}
private def extract(c: List[FooItem]): List[BarItem] = ???
}
这个演员有一个伴生对象
object Test {
def props: Props = ???
}
像这样进行功能提取是否安全:
object Test {
def props: Props = ???
def extract(c: List[FooItem]): List[BarItem] = ???
}
并从另一个演员使用?