Skip to content

Instantly share code, notes, and snippets.

@gerred
Created April 28, 2015 18:06
Show Gist options
  • Save gerred/7cf640cc7784d44b6006 to your computer and use it in GitHub Desktop.
Save gerred/7cf640cc7784d44b6006 to your computer and use it in GitHub Desktop.
defmodule Gabex do
use Application
def start(_type, _args) do
import Supervisor.Spec, warn: false
{:ok, client} = TwitchEx.start_client!
Agent.start_link(fn -> client end, name: ClientServer)
children = [
worker(Gabex.ConnectionHandler, [client]),
worker(Gabex.ESHandler, [client, []]),
worker(Gabex.AdminHandler, [client]),
]
opts = [strategy: :one_for_one, name: Gabex.Supervisor]
Supervisor.start_link(children, opts)
Plug.Adapters.Cowboy.http StatsPlug, []
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment