User Tools

Site Tools


cs330_f2016:lab13supervisortree
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.txt · Last modified: 2021/06/30 23:42 (external edit)