lib/junkie/reactor.rb in junkie-0.0.8 vs lib/junkie/reactor.rb in junkie-0.0.9
- old
+ new
@@ -6,10 +6,11 @@
require 'yaml'
require 'junkie'
require 'junkie/pyload/api'
require 'junkie/pyload/observer'
require 'junkie/errors'
+require 'junkie/webinterface/interface'
module Junkie
class Reactor
include Log, Helper, Config
@@ -25,16 +26,14 @@
def initialize
@config = Config.get_config(self)
log.info("Starting Junkie #{Junkie::VERSION}")
- episode_channel = EM::Channel.new
- notification_channel = EM::Channel.new
-
@channels = {
- episodes: episode_channel,
- notifications: notification_channel
+ episodes: EM::Channel.new,
+ notifications: EM::Channel.new,
+ info: EM::Channel.new,
}
@pyload_observer = Junkie::Pyload::Observer.new(@channels)
@twitter_notification = Junkie::Notification::Twitter.new(@channels)
@@ -94,9 +93,11 @@
EM.add_periodic_timer(@config[:episode_search_refresh] * 60) do
@look_for_new_episodes.call
end
end
+ # start the web interface
+ Junkie::Webinterface::Interface.setup(@channels)
end
end
end
end