Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement