User Tools

Site Tools


cs330_f2016:lab13supervisortree

This is an old revision of the document!


sample_supervisor.exs
defmodule ExampleSuper do
  use Supervisor
 
  def start_link(ns) do
    Supervisor.start_link(__MODULE__, ns )
  end
 
  def init(ns) do
    children = [
      worker(Database, [ns]),
      worker(CustomerService, [ns]),
      worker(Info, [ns]),
      worker(Shipper, [ns]),
      worker(User, [ns]),
      worker(Order, [ns])
    ]
 
    supervise(children, strategy: :one_for_all)
  end
end
cs330_f2016/lab13supervisortree.1490222289.txt.gz · Last modified: 2021/06/30 23:40 (external edit)