Class: Temporalio::Client::Connection::RPCRetryOptions

Inherits:
Struct
  • Object
show all
Defined in:
lib/temporalio/client/connection.rb

Overview

Retry options for server calls when retry is enabled (which it is by default on all high-level Temporalio::Client calls). For most users, the default is preferred.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**kwargs) ⇒ RPCRetryOptions

Returns a new instance of RPCRetryOptions.



76
77
78
79
80
81
82
83
84
85
# File 'lib/temporalio/client/connection.rb', line 76

def initialize(**kwargs)
  # @type var kwargs: untyped
  kwargs[:initial_interval] = 0.1 unless kwargs.key?(:initial_interval)
  kwargs[:randomization_factor] = 0.2 unless kwargs.key?(:randomization_factor)
  kwargs[:multiplier] = 1.5 unless kwargs.key?(:multiplier)
  kwargs[:max_interval] = 5.0 unless kwargs.key?(:max_interval)
  kwargs[:max_elapsed_time] = 10.0 unless kwargs.key?(:max_elapsed_time)
  kwargs[:max_retries] = 10 unless kwargs.key?(:max_retries)
  super
end

Instance Attribute Details

#initial_intervalFloat

Returns Initial backoff interval, default 0.1.

Returns:

  • (Float)

    Initial backoff interval, default 0.1.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/temporalio/client/connection.rb', line 67

RPCRetryOptions = Struct.new(
  :initial_interval,
  :randomization_factor,
  :multiplier,
  :max_interval,
  :max_elapsed_time,
  :max_retries,
  keyword_init: true
) do
  def initialize(**kwargs)
    # @type var kwargs: untyped
    kwargs[:initial_interval] = 0.1 unless kwargs.key?(:initial_interval)
    kwargs[:randomization_factor] = 0.2 unless kwargs.key?(:randomization_factor)
    kwargs[:multiplier] = 1.5 unless kwargs.key?(:multiplier)
    kwargs[:max_interval] = 5.0 unless kwargs.key?(:max_interval)
    kwargs[:max_elapsed_time] = 10.0 unless kwargs.key?(:max_elapsed_time)
    kwargs[:max_retries] = 10 unless kwargs.key?(:max_retries)
    super
  end
end

#max_elapsed_timeFloat

Returns Maximum total time, default 10.0. Can use 0 for no max.

Returns:

  • (Float)

    Maximum total time, default 10.0. Can use 0 for no max.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/temporalio/client/connection.rb', line 67

RPCRetryOptions = Struct.new(
  :initial_interval,
  :randomization_factor,
  :multiplier,
  :max_interval,
  :max_elapsed_time,
  :max_retries,
  keyword_init: true
) do
  def initialize(**kwargs)
    # @type var kwargs: untyped
    kwargs[:initial_interval] = 0.1 unless kwargs.key?(:initial_interval)
    kwargs[:randomization_factor] = 0.2 unless kwargs.key?(:randomization_factor)
    kwargs[:multiplier] = 1.5 unless kwargs.key?(:multiplier)
    kwargs[:max_interval] = 5.0 unless kwargs.key?(:max_interval)
    kwargs[:max_elapsed_time] = 10.0 unless kwargs.key?(:max_elapsed_time)
    kwargs[:max_retries] = 10 unless kwargs.key?(:max_retries)
    super
  end
end

#max_intervalFloat

Returns Maximum backoff interval, default 5.0.

Returns:

  • (Float)

    Maximum backoff interval, default 5.0.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/temporalio/client/connection.rb', line 67

RPCRetryOptions = Struct.new(
  :initial_interval,
  :randomization_factor,
  :multiplier,
  :max_interval,
  :max_elapsed_time,
  :max_retries,
  keyword_init: true
) do
  def initialize(**kwargs)
    # @type var kwargs: untyped
    kwargs[:initial_interval] = 0.1 unless kwargs.key?(:initial_interval)
    kwargs[:randomization_factor] = 0.2 unless kwargs.key?(:randomization_factor)
    kwargs[:multiplier] = 1.5 unless kwargs.key?(:multiplier)
    kwargs[:max_interval] = 5.0 unless kwargs.key?(:max_interval)
    kwargs[:max_elapsed_time] = 10.0 unless kwargs.key?(:max_elapsed_time)
    kwargs[:max_retries] = 10 unless kwargs.key?(:max_retries)
    super
  end
end

#max_retriesInteger

Returns Maximum number of retries, default 10.

Returns:

  • (Integer)

    Maximum number of retries, default 10.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/temporalio/client/connection.rb', line 67

RPCRetryOptions = Struct.new(
  :initial_interval,
  :randomization_factor,
  :multiplier,
  :max_interval,
  :max_elapsed_time,
  :max_retries,
  keyword_init: true
) do
  def initialize(**kwargs)
    # @type var kwargs: untyped
    kwargs[:initial_interval] = 0.1 unless kwargs.key?(:initial_interval)
    kwargs[:randomization_factor] = 0.2 unless kwargs.key?(:randomization_factor)
    kwargs[:multiplier] = 1.5 unless kwargs.key?(:multiplier)
    kwargs[:max_interval] = 5.0 unless kwargs.key?(:max_interval)
    kwargs[:max_elapsed_time] = 10.0 unless kwargs.key?(:max_elapsed_time)
    kwargs[:max_retries] = 10 unless kwargs.key?(:max_retries)
    super
  end
end

#multiplierFloat

Returns Backoff multiplier, default 1.5.

Returns:

  • (Float)

    Backoff multiplier, default 1.5.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/temporalio/client/connection.rb', line 67

RPCRetryOptions = Struct.new(
  :initial_interval,
  :randomization_factor,
  :multiplier,
  :max_interval,
  :max_elapsed_time,
  :max_retries,
  keyword_init: true
) do
  def initialize(**kwargs)
    # @type var kwargs: untyped
    kwargs[:initial_interval] = 0.1 unless kwargs.key?(:initial_interval)
    kwargs[:randomization_factor] = 0.2 unless kwargs.key?(:randomization_factor)
    kwargs[:multiplier] = 1.5 unless kwargs.key?(:multiplier)
    kwargs[:max_interval] = 5.0 unless kwargs.key?(:max_interval)
    kwargs[:max_elapsed_time] = 10.0 unless kwargs.key?(:max_elapsed_time)
    kwargs[:max_retries] = 10 unless kwargs.key?(:max_retries)
    super
  end
end

#randomization_factorFloat

Returns Randomization jitter to add, default 0.2.

Returns:

  • (Float)

    Randomization jitter to add, default 0.2.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/temporalio/client/connection.rb', line 67

RPCRetryOptions = Struct.new(
  :initial_interval,
  :randomization_factor,
  :multiplier,
  :max_interval,
  :max_elapsed_time,
  :max_retries,
  keyword_init: true
) do
  def initialize(**kwargs)
    # @type var kwargs: untyped
    kwargs[:initial_interval] = 0.1 unless kwargs.key?(:initial_interval)
    kwargs[:randomization_factor] = 0.2 unless kwargs.key?(:randomization_factor)
    kwargs[:multiplier] = 1.5 unless kwargs.key?(:multiplier)
    kwargs[:max_interval] = 5.0 unless kwargs.key?(:max_interval)
    kwargs[:max_elapsed_time] = 10.0 unless kwargs.key?(:max_elapsed_time)
    kwargs[:max_retries] = 10 unless kwargs.key?(:max_retries)
    super
  end
end