May 2017
Intermediate to advanced
414 pages
13h
English
We create an actor that computes Fibonacci number, and sends the result to the sender who sent him the message to compute the Fibonacci.
In the actor receive block, we send the Fibonacci result back to the sender. Actors, by nature, know who has sent them the message, thus we always have the sender present in the context of the receive block.
When you send a message to the actor using a question mark (?), it returns a future promising that you will get the result when the operation would be completed.
We will learn about futures in later chapters.
Read now
Unlock full access