Here is my code:
class testActor extends Actor {
var test = "test2"
def receive = {
case "test" ⇒
"works"
}
}
def test = Action {
var test = "test"
val system = ActorSystem("MySystem")
val myActor = system.actorOf(Props[testActor.testActor], name = "testActor")
test = Await.result(myActor ? "test", Duration(1, TimeUnit.SECONDS))
}
I am getting an error with this line:
test = Await.result(myActor ? "test", Duration(1, TimeUnit.SECONDS))
The error is:
could not find implicit value for parameter timeout: akka.util.Timeout
add something like
implicit val timeout = Timeout(5 seconds). See http://doc.akka.io/docs/akka/2.0.1/scala/futures.htmlBy the way, you’ll also need to change
and