February 2018
Intermediate to advanced
552 pages
13h 46m
English
It follows the Send and Receive model, which means send a message asynchronously and return Future to retrieve results sometime in the future. It is known as the Ask pattern:
val result: Future[Result] = (actor ? message).mapTo[String]
In the Akka Framework API, this ask pattern is defined at the akka.pattern package:
import akka.pattern.ask ask(actor, message) // use it directly actor ask message // use it by implicit conversion actor ? message // use it by implicit conversion
Read now
Unlock full access