Digging Deeper

The gen_server is actually rather simple. We haven’t been through all the interface functions in gen_server, and we haven’t talked about all the arguments to all the interface functions. Once you understand the basic ideas, you can look up the details in the manual page for gen_server.

In this chapter, we looked only at the simplest possible way to use gen_server, but this should be adequate for most purposes. More complex applications often let gen_server reply with a noreply return value and delegate the real reply to another process. For information about this, read the “Design Principles” documentation[37] and the manual pages for the modules sys and proc_lib.

This chapter introduced the idea of abstracting the behavior ...

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.