Class: Watobo::PassiveScanner::Engine

Inherits:
Object
  • Object
show all
Defined in:
lib/watobo/core/passive_scanner.rb

Instance Method Summary collapse

Constructor Details

#initializeEngine

Returns a new instance of Engine.



8
9
10
# File 'lib/watobo/core/passive_scanner.rb', line 8

def initialize
  @t = nil
end

Instance Method Details

#runObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/watobo/core/passive_scanner.rb', line 12

def run
  @t = Thread.new {
    loop do
      if Watobo::PassiveScanner.queue.size > 0
        chat = Watobo::PassiveScanner.pop
        unless chat.nil?
          Watobo::PassiveModules.each do |test_module|
            begin
              test_module.do_test(chat)
            rescue => bang
              puts bang
              puts bang.backtrace #if $DEBUG
              #return false
            end
          end
        end
      else
        sleep 0.5
      end
    end
  }
end