Class: Heartbeat

Inherits:
Object
  • Object
show all
Defined in:
lib/heartbeat.rb

Instance Method Summary collapse

Constructor Details

#initializeHeartbeat

Returns a new instance of Heartbeat.



7
8
9
10
11
12
# File 'lib/heartbeat.rb', line 7

def initialize
  @logger = Logger.new("log/heartbeat.log")
  @logger.debug "Heartbeat#initialize : Connecting to AMQP server"
  @conn = Bunny.new(:logging => true)
  @conn.start
end

Instance Method Details

#runObject



14
15
16
17
18
# File 'lib/heartbeat.rb', line 14

def run
  EM.run do
    start_amqp_heartbeat 
  end
end