Class: NFAgent::Poller

Inherits:
Object show all
Includes:
EM::Deferrable
Defined in:
lib/nfagent/poller.rb

Instance Method Summary collapse

Constructor Details

#initializePoller

Returns a new instance of Poller.



5
6
7
# File 'lib/nfagent/poller.rb', line 5

def initialize
  @info = Info.new
end

Instance Method Details

#send_heartbeatObject



9
10
11
12
13
14
15
16
# File 'lib/nfagent/poller.rb', line 9

def send_heartbeat
  payload = @info.to_hash
  Log.info("Polling: #{payload.inspect}")
  response = Client.post(:poller, payload)
  if !response.ok?
    Log.error("Poll Failed: #{response.message}")
  end
end