Error message with Scala AKKA Actor

Viewed 5729

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

1 Answers
Related