Exploring the actor model for async programming
If you have coded complex solutions to complex problems before in an object-oriented fashion, you will be familiar with objects, attributes, and class inheritance. If you are not familiar, do not worry—we are not going to implement them in this chapter. However, it is advised that you read up on the concepts of object-oriented programming to gain a full appreciation for the actor model.
For objects, we have a range of processes and an encapsulated state around those processes, which can be attributes of the object. Objects are useful for compartmentalizing logic and state around a concept or process. Some people merely see objects as a tool to reduce repeated code; however, objects can be used as interfaces between modules or can be used to orchestrate processes. Objects are the cornerstone of many complex systems. However, when it comes to asynchronous programming, objects can get messy—for instance, when we have two...