September 2016
Beginner
448 pages
14h 23m
English
In this chapter
Previous chapters have advanced many reasons for using stateless components when implementing a system to avoid all kinds of problems, like restoring state after an error. But in most cases, there are components within a system that need state to be able to provide the required functionality. You’ve already seen two possible ways to keep state in an actor. The first is to use class variables, which we showed in our aggregator example (section 8.4.2). This is the simplest way. The second solution is to use the become/unbecome functionality, which we used in our state-dependent ...