Class: ScoutAgent::Agent::CommunicationAgent
- Inherits:
-
ScoutAgent::Agent
- Object
- ScoutAgent::Agent
- ScoutAgent::Agent::CommunicationAgent
- Defined in:
- lib/scout_agent/agent/communication_agent.rb
Constant Summary collapse
- RECONNECT_WAIT =
60
Instance Attribute Summary
Attributes inherited from ScoutAgent::Agent
Instance Method Summary collapse
- #finish ⇒ Object
-
#initialize ⇒ CommunicationAgent
constructor
A new instance of CommunicationAgent.
- #run ⇒ Object
Methods inherited from ScoutAgent::Agent
Methods included from Tracked
#clear_status, #force_status_database_reload, #status, #status_database, #status_log
Constructor Details
#initialize ⇒ CommunicationAgent
Returns a new instance of CommunicationAgent.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/scout_agent/agent/communication_agent.rb', line 13 def initialize super # setup our log and status Order.log = log # pass on our log Order.load_all # load supported orders @agent_jid = nil @jabber = nil @roster = nil @shutdown_thread = nil end |
Instance Method Details
#finish ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/scout_agent/agent/communication_agent.rb', line 35 def finish if @shutdown_thread @shutdown_thread.run else exit end end |
#run ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/scout_agent/agent/communication_agent.rb', line 25 def run login update_status("Online since #{Time.now.utc.to_db_s}") fetch_roster install_subscriptions_callback listen close_connection end |