Chapter 23Making a System with OTP

In this chapter, we’re going to make a system that could function as the back end of a web-based company. Our company has two items for sale: prime numbers and areas. Customers can buy a prime number from us, or we’ll calculate the area of a geometric object for them. I think our company has great potential.

We’ll build two servers: one to generate prime numbers and the other to compute areas. To do this, we’ll use the gen_server framework that we talked about in Getting Started with gen_server.

When we build the system, we have to think about errors. Even though we have thoroughly tested our software, we might not have caught all the bugs. We’ll assume that one of our servers has a fatal error that ...

Get Programming Erlang, 2nd Edition 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.