Class: ErrbitZmqHandler::Handler

Inherits:
DripDrop::Node
  • Object
show all
Defined in:
lib/errbit_zmq_handler/handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#uriObject

Returns the value of attribute uri.



5
6
7
# File 'lib/errbit_zmq_handler/handler.rb', line 5

def uri
  @uri
end

Instance Method Details

#actionObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/errbit_zmq_handler/handler.rb', line 6

def action
  self.uri = ErrbitZmqHandler.configuration.uri 
  route :exceptions, :zmq_subscribe, uri, :bind, :msg_format => :raw

  exceptions.on_recv do |messages|
    xml = messages.first.copy_out_string
    puts "[#{Time.now}] got notice"
    start = Time.now
    ErrorReport.new(xml).generate_notice!
    puts "Notice saved in #{Time.now - start} seconds\n\n"
  end
end