Chapter 1. The Actor Model
It is essential to understand how actors were meant to be used to realize their full value, and that’s what you will learn in this chapter. Here, we explore actors—how they work, and how they interact with one another and the outside world.
Many of the techniques we use to design software teach you that it is important to look at the real world before writing code. We must understand the use case for the software. We need to ask questions about who will be using it and how they will use it. These questions are critical to the design of good software. But in the pursuit of our design, we often forget to ask ourselves an important question: “How long will it take?” Yet, anyone who has written a highly concurrent system knows that time is an integral part of how we develop our software.
Let’s explore a bit far afield from software for a moment—don’t worry, we’ll show how this relates to software development in a moment!
Reality Is Eventually Consistent
Consider the example of reaching for a cup of coffee. On the surface, this might seem like a very simple example. You reach out and pick up a cup of coffee. Not much is happening there. But let’s look deeper.
To be able to pick up the coffee, you need to know where it is. You can look over and see the cup, but are you seeing it as it is, or as it was? The information you use to determine the location of the cup is based on the photons reflected from that cup. Those photons take time to travel. Further, when ...