Class: Soka::Agents::RetryConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/soka/agents/dsl_methods.rb

Overview

Configuration for retry behavior

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRetryConfig

Returns a new instance of RetryConfig.



134
135
136
137
138
# File 'lib/soka/agents/dsl_methods.rb', line 134

def initialize
  @max_retries = 3
  @backoff_strategy = :exponential
  @retry_on = []
end

Instance Attribute Details

#backoff_strategyObject

Returns the value of attribute backoff_strategy.



132
133
134
# File 'lib/soka/agents/dsl_methods.rb', line 132

def backoff_strategy
  @backoff_strategy
end

#max_retriesObject

Returns the value of attribute max_retries.



132
133
134
# File 'lib/soka/agents/dsl_methods.rb', line 132

def max_retries
  @max_retries
end

#retry_onObject

Returns the value of attribute retry_on.



132
133
134
# File 'lib/soka/agents/dsl_methods.rb', line 132

def retry_on
  @retry_on
end

Instance Method Details

#to_hHash

Convert to hash

Returns:

  • (Hash)

    The configuration as a hash



142
143
144
145
146
147
148
# File 'lib/soka/agents/dsl_methods.rb', line 142

def to_h
  {
    max_retries: max_retries,
    backoff_strategy: backoff_strategy,
    retry_on: retry_on
  }
end