Application design

We have the basic computational units identified in the beginning for each of the tasks that will be performed on the sentence in order to count the words. We model our actors around the same computational task model and create the following three actors for each task:

  • Map actor
  • Reduce actor
  • Aggregate actor

To create and manage the lifecycle of these actors, we create another actor called Master actor. The communication between actors will happen via immutable messages as follows:

  1. The Master actor sends the sentence as a string to the Map actor.
  2. The Map actor maps the words in the sentence and returns the MapData message to the The Master actor. Master actor sends the MapData message to the Reduce actor.
  3. The Reduce actor acts on ...

Get Akka Essentials now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.