我的环境是 eclipse indigo,我正在尝试添加一个自定义调度程序。
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
我已经尝试将它添加到 akka-2.0.2/config/application.config 中的 application.config