Class: Temporal::Client::Serializer::RetryPolicy

Inherits:
Base
  • Object
show all
Defined in:
lib/temporal/client/serializer/retry_policy.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Temporal::Client::Serializer::Base

Instance Method Details

#to_protoObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/temporal/client/serializer/retry_policy.rb', line 7

def to_proto
  return unless object

  non_retriable_errors = Array(object.non_retriable_errors).map(&:name)
  options = {
    initial_interval: object.interval,
    backoff_coefficient: object.backoff,
    maximum_interval: object.max_interval,
    maximum_attempts: object.max_attempts,
    non_retryable_error_types: non_retriable_errors,
  }.compact

  Temporal::Api::Common::V1::RetryPolicy.new(options)
end