OTP Supervisor

Minimal snippet for implementing a supervisor process in Elixir.


defmodule MyModule.Supervisor do
  use Supervisor

  def start_link(opts \\ []) do
    Supervisor.start_link(__MODULE__, opts, name: __MODULE__)
  end

  def init(_opts) do
    children = [
      {MyModule.MyWorker, [name: Crawler.MyWorker]}
    ]

    Supervisor.init(children, strategy: :one_for_one)
  end
end

Linked Technologies

What it's made of

illustration of Elixir
Elixir

Harness the power of concurrent, fault-tolerant programming for scalable, maintainable applications. Code that flows like water!

Linked Categories

Where it's useful

illustration of Software Architecture
Software Architecture

Dive into the world of Software Architecture where design meets functionality. Explore frameworks, patterns, and best practices that define the structure of software systems, making them robust, scalable, and maintainable.