In Akka, rather than using onComplete on a future response created with ?, I am trying to use pipeTo because that is supposedly the preferred pattern. However, I don't seem to be receiving any Throwables or Failures when the future times out. What should I expect to receive in my actor if a timeout occurs when using pipeTo? What about when a different exception is thrown? Example code:
class Simple(otherActor : ActorRef) extends Actor{
def receive = {
case "some_msg" => {
val implicit timeout = Timeout(1 seconds)
val response = otherActor ? "hello"
response pipeTo self
}
// case ??? // How do I handle timeouts?
}
}
If no message is automatically sent when a timeout occurs, how am I supposed to handle timeouts with pipeTo?