1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
defmodule LSG.IRC do
def application_childs do
{:ok, irc_client} = ExIRC.start_link!
import Supervisor.Spec
[
worker(Registry, [[keys: :duplicate, name: IRC.PubSub]], id: :registry_irc),
worker(IRC.UserTrack.Storage, []),
worker(IRC.ConnectionHandler, [irc_client]),
worker(IRC.LoginHandler, [irc_client]),
worker(IRC.UserTrackHandler, [irc_client]),
worker(IRC.PubSubHandler, [irc_client], [name: :irc_pub_sub]),
]
++
for handler <- Application.get_env(:lsg, :irc)[:handlers] do
worker(handler, [irc_client], [name: handler])
end
++
for plugin <- Application.get_env(:lsg, :irc)[:plugins] do
worker(plugin, [], [name: plugin])
end
end
end
|