Skip to content

Instantly share code, notes, and snippets.

@radzserg
Created January 16, 2019 12:06
Show Gist options
  • Select an option

  • Save radzserg/78bd515c60f6d3c31668c0bab1e06eb3 to your computer and use it in GitHub Desktop.

Select an option

Save radzserg/78bd515c60f6d3c31668c0bab1e06eb3 to your computer and use it in GitHub Desktop.
defmodule App.Application do
use Application
def start(_type, _args) do
import Supervisor.Spec
children = [
supervisor(App.Repo, [])
supervisor(App.Web.Endpoint, []),
worker(Rsed.EventDispatcher, []) # adds our event dispatcher
]
opts = [strategy: :one_for_one, name: App.Supervisor]
res = Supervisor.start_link(children, opts)
res
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment