Method: MultipleMan::ChannelMaintenance::Reaper#initialize

Defined in:
lib/multiple_man/channel_maintenance/reaper.rb

#initialize(config) ⇒ Reaper

Returns a new instance of Reaper.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/multiple_man/channel_maintenance/reaper.rb', line 4

def initialize(config)
  @config = config
  @queue = Queue.new

  @worker = Thread.new do
    loop do
      channel = queue.pop
      begin
        channel.close unless closed?
        puts "Channel #{channel.number} closed!"
      rescue Exception
        sleep config.connection_recovery[:time_between_retries]
        retry
      end
    end
  end
end