Module: Phronomy::Agent::Concerns::Retryable::ClassMethods
- Defined in:
- lib/phronomy/agent/concerns/retryable.rb
Overview
Class-level DSL methods mixed into the including agent class.
Instance Attribute Summary collapse
-
#_retry_policy ⇒ Hash?
readonly
Returns the configured retry policy, or nil when none is set.
-
#_sleep_proc ⇒ #call
Injectable sleep callable for testing (shared with Tool::Base pattern).
Instance Method Summary collapse
-
#retry_policy(times: 0, wait: 0, base: 1.0) ⇒ Object
Configures a retry policy that wraps the full #invoke call.
Instance Attribute Details
#_retry_policy ⇒ Hash? (readonly)
Returns the configured retry policy, or nil when none is set.
34 35 36 |
# File 'lib/phronomy/agent/concerns/retryable.rb', line 34 def _retry_policy @_retry_policy end |
#_sleep_proc ⇒ #call
Injectable sleep callable for testing (shared with Tool::Base pattern).
38 39 40 |
# File 'lib/phronomy/agent/concerns/retryable.rb', line 38 def _sleep_proc @_sleep_proc || method(:sleep) end |
Instance Method Details
#retry_policy(times: 0, wait: 0, base: 1.0) ⇒ Object
Configures a retry policy that wraps the full #invoke call. GuardrailError is never retried regardless of this setting.
28 29 30 |
# File 'lib/phronomy/agent/concerns/retryable.rb', line 28 def retry_policy(times: 0, wait: 0, base: 1.0) @_retry_policy = {times: times, wait: wait, base: base} end |