Module: Phronomy::Agent::Concerns::Retryable::ClassMethods Private
- Defined in:
- lib/phronomy/agent/concerns/retryable.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Class-level DSL methods mixed into the including agent class.
Instance Attribute Summary collapse
-
#_retry_policy ⇒ Hash?
readonly
private
Returns the configured retry policy, or nil when none is set.
-
#_sleep_proc ⇒ #call
private
Injectable sleep callable for testing (shared with Tool::Base pattern).
Instance Method Summary collapse
-
#retry_policy(times: 0, wait: 0, base: 1.0) ⇒ Object
private
Configures a retry policy that wraps the full #invoke call.
Instance Attribute Details
#_retry_policy ⇒ Hash? (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the configured retry policy, or nil when none is set.
36 37 38 |
# File 'lib/phronomy/agent/concerns/retryable.rb', line 36 def _retry_policy @_retry_policy end |
#_sleep_proc ⇒ #call
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Injectable sleep callable for testing (shared with Tool::Base pattern).
41 42 43 |
# File 'lib/phronomy/agent/concerns/retryable.rb', line 41 def _sleep_proc @_sleep_proc || method(:sleep) end |
Instance Method Details
#retry_policy(times: 0, wait: 0, base: 1.0) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Configures a retry policy that wraps the full #invoke call. GuardrailError is never retried regardless of this setting.
30 31 32 |
# File 'lib/phronomy/agent/concerns/retryable.rb', line 30 def retry_policy(times: 0, wait: 0, base: 1.0) @_retry_policy = {times: times, wait: wait, base: base} end |