summaryrefslogblamecommitdiff
path: root/lib/lsg_irc.ex
blob: 482cb5d6ed1da996bc1c4fd99a1e65e33445f77c (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
                    




                                         





                                                                                  


                                                                
                                                    
       


                                                              
       

     
 
   
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