Search⌘ K
AI Features

Understanding the Lifecycle Building Blocks

Understand the fundamental lifecycle building blocks in Elixir using OTP. Learn how to manage processes with start_link, supervisors, and configuration, and how to organize process lifecycles hierarchically for fault tolerance and control.

At the risk of sounding like a broken record, we’ll repeat that our project may never need to create its processes. Many projects are libraries, meaning they’ll never need to have their service layer. They don’t need start links or supervisors at all. In the terms we’ve discussed so far, these libraries will never use the “big, loud worker-bee” layers.

Handling processes using OTP

When our project does need processes, it will often use the OTP architecture. OTP might be overkill for some use cases, but most often, OTP lets our processes exist seamlessly with others that need the common lifecycle services we’ll discuss in the sections that follow. For example, a typical OTP ...