right_agent 0.13.5 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/right_agent/actors/agent_manager.rb +1 -32
- data/lib/right_agent/agent.rb +243 -230
- data/lib/right_agent/dispatched_cache.rb +4 -5
- data/lib/right_agent/dispatcher.rb +146 -157
- data/lib/right_agent/pid_file.rb +1 -1
- data/lib/right_agent/platform.rb +14 -14
- data/lib/right_agent/scripts/agent_controller.rb +2 -4
- data/lib/right_agent/sender.rb +214 -223
- data/lib/right_agent/serialize/secure_serializer.rb +2 -2
- data/right_agent.gemspec +3 -3
- data/spec/agent_spec.rb +50 -171
- data/spec/dispatched_cache_spec.rb +13 -19
- data/spec/dispatcher_spec.rb +192 -254
- data/spec/sender_spec.rb +212 -168
- metadata +7 -4
@@ -30,7 +30,7 @@ class AgentManager
|
|
30
30
|
|
31
31
|
on_exception { |meth, deliverable, e| RightScale::ExceptionMailer.deliver_notification(meth, deliverable, e) }
|
32
32
|
|
33
|
-
expose_idempotent :ping, :stats, :profile, :set_log_level, :connect, :disconnect, :connect_failed
|
33
|
+
expose_idempotent :ping, :stats, :profile, :set_log_level, :connect, :disconnect, :connect_failed
|
34
34
|
expose_non_idempotent :execute, :terminate
|
35
35
|
|
36
36
|
# Valid log levels
|
@@ -215,37 +215,6 @@ class AgentManager
|
|
215
215
|
res
|
216
216
|
end
|
217
217
|
|
218
|
-
# Tune connection heartbeat frequency for all brokers
|
219
|
-
# Any response to this request is not likely to get through if :immediate is specified
|
220
|
-
# because the broker connections will be in flux
|
221
|
-
# Use of :immediate should be avoided when this is a fanned out request to avoid
|
222
|
-
# overloading the brokers
|
223
|
-
#
|
224
|
-
# === Parameters
|
225
|
-
# options(Hash):: Tune options:
|
226
|
-
# :heartbeat(Integer):: New AMQP connection heartbeat setting, nil or 0 means disable
|
227
|
-
# :immediate(Boolean):: Whether to tune heartbeat immediately rather than defer until next
|
228
|
-
# status check
|
229
|
-
#
|
230
|
-
# === Return
|
231
|
-
# res(RightScale::OperationResult):: Success unless exception is raised
|
232
|
-
def tune_heartbeat(options)
|
233
|
-
options = RightScale::SerializationHelper.symbolize_keys(options)
|
234
|
-
res = success_result
|
235
|
-
begin
|
236
|
-
if options[:immediate]
|
237
|
-
if error = @agent.tune_heartbeat(options[:heartbeat])
|
238
|
-
res = error_result(error)
|
239
|
-
end
|
240
|
-
else
|
241
|
-
@agent.defer_task { @agent.tune_heartbeat(options[:heartbeat]) }
|
242
|
-
end
|
243
|
-
rescue Exception => e
|
244
|
-
res = error_result("Failed to tune heartbeat", e)
|
245
|
-
end
|
246
|
-
res
|
247
|
-
end
|
248
|
-
|
249
218
|
# Terminate self
|
250
219
|
#
|
251
220
|
# === Parameters
|