In this recipe, we will see how to use a future with an actor, and how to retrieve the result of a computation done by a future.
Using futures with actors
Getting ready
Just import the Hello-Akka project, and the other prerequisites are the same as earlier.
How to do it...
The following are the steps to use a future with an actor and to retrieve a result of the computation:
- Create a scala file, FutureWithActor.scala, in the com.packt.chapter4 package.
- Add the following imports to the top of the file:
import akka.actor.{Actor, ActorSystem, Props}
import akka.pattern.ask
import akka.util...