SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. defmodule MyApp.Application do
  2.   use Application
  3.   import Supervisor.Spec
  4.  
  5.   def start(_type, _args) do
  6.     children_sv1 = [
  7.       supervisor(MyApp.Repo, []),
  8.       ... # other workers
  9.     ]
  10.  
  11.     children_sv2 = [
  12.       supervisor(MyApp.Endpoint, []),
  13.       ... # other workers
  14.     ]
  15.  
  16.     opts1 = [strategy: :one_for_one, name: MyApp.Supervisor1]
  17.     opts2 = [strategy: :one_for_one, name: MyApp.Supervisor2]
  18.  
  19.     Supervisor.start_link(children_sv1, opts)
  20.     Supervisor.start_link(children_sv2, opts)
  21.   end
  22. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top