Class: Emque::Producing::Publisher::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/emque/producing/publisher/base.rb

Direct Known Subclasses

RabbitMq

Instance Method Summary collapse

Instance Method Details

#handle_error(e) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/emque/producing/publisher/base.rb', line 9

def handle_error(e)
  Emque::Producing.configuration.error_handlers.each do |handler|
    begin
      handler.call(e, nil)
    rescue => ex
      Emque::Producing.logger.error "Producer error hander raised an error"
      Emque::Producing.logger.error ex
      Emque::Producing.logger.error Array(ex.backtrace).join("\n")
    end
  end
end

#host_nameObject



5
6
7
# File 'lib/emque/producing/publisher/base.rb', line 5

def host_name
  Socket.gethostbyname(Socket.gethostname).first
end