1
我的环境是蚀食靛蓝,我想添加一个自定义调度。添加到配置文件Akka
import akka.actor.Actor
import akka.actor.ActorRef
import akka.dispatch.MessageDispatcher
import akka.dispatch._
import akka.event.Logging
import akka.actor.ActorSystem
import akka.actor.Props
import akka.dispatch;
class MyActor extends Actor {
Console.println("World!");
val log = Logging(context.system, this)
def receive = {
case "test" => log.info("received test")
case _ => log.info("received unknown message")
}
}
object Main extends App {
val system = ActorSystem("MySystem")
Console.println("Hello");
val myActor = system.actorOf(Props[MyActor].withDispatcher("my-dispatcher"), name = "myactor")
}
我正在关注这个例子。 http://doc.akka.io/docs/akka/2.0.2/scala/dispatchers.html
我已经尝试过将它添加到application.config阿卡-2.0.2 /配置/ application.config
感谢您的帮助。我只需要将配置文件放在main/src文件夹下并且工作。再次谢谢你 :)。 – BRS 2012-07-16 16:03:25