Akka FSM

The Manager pushes the cookie-making process forward by coordinating all other inhabitants of the bakery. It does so by taking the messages representing job results from one actor and passing them further along to an appropriate successor. It is important that this process is consequent, that is, it should be impossible to make raw cookies at the moment since we only have a shopping list and no dough. We'll represent this behavior as a state machine. 

An FSM is an abstraction defined by a set of states the machine can be in. For each state, it also defines which message types can be accepted in this state and the possible reaction of the machine, including its new state.

Let's dive into the code and see how this approach is implemented ...

Get Learn Scala Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.