This is probably a very simple mistake, but I cannot get it to work correctly. I am using akka 2.2.3 to create an actor based application in scala.
The simplified setup is as follows:
object Main { def main(args: Array[String]) = { val system = ActorSystem("Test") val discoverer = system.actorOf(Props[Discoverer], "discoverer") implicit val timeout = Timeout(5.seconds) val not = discoverer ? Messages.Find(something) not.onComplete { case Success(va) => println(va) case Failure(err) => println(err) } ... } }
And the main actor
class Discoverer extends Actor { override def preStart() = { val refresher = context.actorOf(Props[Refresher], "refresher") refresher ! Refresh } def receive = { case _ => sender ! Answer } }
And the actor Refresher
class Refresher extends Actor { ... }
What you should remove from this is that none of my participants have parameterized constructors.
However, if I try to run my application, it does not work with
[ERROR] [12/09/2013 13:17:06.893] [Test-akka.actor.default-dispatcher-3] [akka:
What is my mistake? Shouldn't I create my actors using .actorOf(Props[Class], "actorname") ?
scala akka
mgttlinger
source share