Skip to content

Instantly share code, notes, and snippets.

@jonlunsford
Created November 1, 2017 22:34
Show Gist options
  • Save jonlunsford/f7f5c7f8e072609362bc624d810be1ed to your computer and use it in GitHub Desktop.
Save jonlunsford/f7f5c7f8e072609362bc624d810be1ed to your computer and use it in GitHub Desktop.
defmodule Messenger.Supervisor do
use Supervisor
def start_link(opts) do
Supervisor.start_link(__MODULE__, :ok, opts)
end
def init(:ok) do
children = [
worker(:gen_smtp_server, [Messenger.Server, Application.get_env(:messenger, :smtp_opts)])
]
Supervisor.init(children, strategy: :one_for_one)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment