August 2018
Intermediate to advanced
380 pages
10h 2m
English
Imagine we need to have multiple actors that all output a greeting to a given name to the log. Imagine also that we need to abstract away the fact that there are multiple actors in the system from the end user. We are going to do so by creating a single supervising actor that is going to be in charge of the execution of all its child actors. The child actors will be the actors that output the greeting message to the log, and the parent actor will be a manager that represents them.
The protocol is going to be as follows. First, create a GreetingsManager actor. Then, you are going to send a SpawnGreeters message to spawn a number of greeter actors parameterized by the number of greeters required. These spawned greeters must ...