class CrawlStation::Launcher

Public Class Methods

new() click to toggle source
# File lib/crawl_station/launcher.rb, line 6
def initialize
  @exit_sign = false
  subscribe 'exit_launcher', :exit_message
end

Public Instance Methods

exit_message(_topic, data) click to toggle source
# File lib/crawl_station/launcher.rb, line 24
def exit_message(_topic, data)
  @exit_sign = data
end
start() click to toggle source
# File lib/crawl_station/launcher.rb, line 11
def start
  CS.logger.debug('station starting ... ')

  CS.concurrent_count.times do
    supervisor = CS::Producer.pool args: [CS.schedule, CS.cache]
    supervisor.async.start
  end
  loop do
    sleep(10)
    break if @exit_sign
  end
end