January 2013
Beginner to intermediate
624 pages
17h 18m
English
The examples shown in Chapter 10 were suitable for demonstrative purposes, but they won’t take you very far in your own projects. It’s not that the examples were bad; it’s just that there’s no huge advantage to processes and actors if they’re just functions with messages. To reap the benefits, we need to be able to hold state in a process.
In this chapter, we will apply the concurrency concepts and primitives to practical examples that are able to hold state.
Let’s first create a function in a new kitchen.erl module that will let a process act like a refrigerator. The process will allow two operations: storing food in the fridge and taking food from the fridge. It should only be possible to take ...
Read now
Unlock full access