20.6. Synchronous Messages and Futures
An actor can send a message and wait for a reply, by using the ?! operator. For example,
val reply = account !? Deposit(1000)
reply match {
case Balance(bal) => println("Current Balance: " + bal)
}
You are currently reading a PREVIEW of this book.
Get instant access to over
$1 million worth of books and videos.
Start a Free Trial