On all our previous example we have been using Tell method to send messages to actors, in Akka this is known as fire-and-forget. Which means you send a message and there is no blocking, Actors, handle a separate thread to handle the actual work.
But what happens when you need a return value? you pass a message and some time down the line you want to know what is the response. Here is where Ask comes in to play:
Ask makes use of Java’s completable future, to see that when do the response does come back, we can then do some things to it. On the Actor side, we make use of getSender.tell to return the actual message to CompletableFuture object.