Class: Temporal::RetryPolicy
- Inherits:
-
Struct
- Object
- Struct
- Temporal::RetryPolicy
- Defined in:
- lib/temporal/retry_policy.rb
Overview
See docs.temporal.io/docs/go/retries/ for go documentation of equivalent concepts.
Defined Under Namespace
Classes: InvalidRetryPolicy
Instance Attribute Summary collapse
-
#backoff ⇒ Object
Returns the value of attribute backoff.
-
#interval ⇒ Object
Returns the value of attribute interval.
-
#max_attempts ⇒ Object
Returns the value of attribute max_attempts.
-
#max_interval ⇒ Object
Returns the value of attribute max_interval.
-
#non_retriable_errors ⇒ Object
Returns the value of attribute non_retriable_errors.
Instance Method Summary collapse
Instance Attribute Details
#backoff ⇒ Object
Returns the value of attribute backoff
5 6 7 |
# File 'lib/temporal/retry_policy.rb', line 5 def backoff @backoff end |
#interval ⇒ Object
Returns the value of attribute interval
5 6 7 |
# File 'lib/temporal/retry_policy.rb', line 5 def interval @interval end |
#max_attempts ⇒ Object
Returns the value of attribute max_attempts
5 6 7 |
# File 'lib/temporal/retry_policy.rb', line 5 def max_attempts @max_attempts end |
#max_interval ⇒ Object
Returns the value of attribute max_interval
5 6 7 |
# File 'lib/temporal/retry_policy.rb', line 5 def max_interval @max_interval end |
#non_retriable_errors ⇒ Object
Returns the value of attribute non_retriable_errors
5 6 7 |
# File 'lib/temporal/retry_policy.rb', line 5 def non_retriable_errors @non_retriable_errors end |
Instance Method Details
#validate! ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/temporal/retry_policy.rb', line 10 def validate! unless max_attempts == 1 || (interval && backoff) raise InvalidRetryPolicy, 'interval and backoff must be set if max_attempts != 1' end unless [interval, max_interval].compact.all? { |arg| arg.is_a?(Integer) } raise InvalidRetryPolicy, 'All intervals must be specified in whole seconds' end unless [interval, max_interval].compact.all? { |arg| arg > 0 } raise InvalidRetryPolicy, 'All intervals must be greater than 0' end end |