Class: NFAgent::Poller
- Includes:
- EM::Deferrable
- Defined in:
- lib/nfagent/poller.rb
Instance Method Summary collapse
-
#initialize ⇒ Poller
constructor
A new instance of Poller.
- #send_heartbeat ⇒ Object
Constructor Details
#initialize ⇒ Poller
5 6 7 |
# File 'lib/nfagent/poller.rb', line 5 def initialize @info = Info.new end |
Instance Method Details
#send_heartbeat ⇒ Object
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 |