@@ -13,7 +13,7 @@ class Client
1313 # Connection to Temporal server that is not namespace specific. Most users will use {Client.connect} instead of this
1414 # directly.
1515 class Connection
16- # Options as returned from {dup_options } for +**to_h+ splat use in {initialize}. See {initialize} for details.
16+ # Options as returned from {options } for +**to_h+ splat use in {initialize}. See {initialize} for details.
1717 Options = Struct . new (
1818 :target_host ,
1919 :api_key ,
@@ -72,7 +72,8 @@ class Connection
7272 :max_retries ,
7373 keyword_init : true
7474 ) do
75- def initialize ( *, **kwargs )
75+ def initialize ( **kwargs )
76+ # @type var kwargs: untyped
7677 kwargs [ :initial_interval ] = 0.1 unless kwargs . key? ( :initial_interval )
7778 kwargs [ :randomization_factor ] = 0.2 unless kwargs . key? ( :randomization_factor )
7879 kwargs [ :multiplier ] = 1.5 unless kwargs . key? ( :multiplier )
@@ -95,7 +96,8 @@ def initialize(*, **kwargs)
9596 :timeout ,
9697 keyword_init : true
9798 ) do
98- def initialize ( *, **kwargs )
99+ def initialize ( **kwargs )
100+ # @type var kwargs: untyped
99101 kwargs [ :interval ] = 30.0 unless kwargs . key? ( :interval )
100102 kwargs [ :timeout ] = 15.0 unless kwargs . key? ( :timeout )
101103 super
@@ -117,8 +119,8 @@ def initialize(*, **kwargs)
117119 keyword_init : true
118120 )
119121
120- # @return [String] Client identity .
121- attr_reader :identity
122+ # @return [Options] Frozen options for this client which has the same attributes as {initialize} .
123+ attr_reader :options
122124
123125 # @return [WorkflowService] Raw gRPC workflow service.
124126 attr_reader :workflow_service
@@ -130,7 +132,7 @@ def initialize(*, **kwargs)
130132 attr_reader :cloud_service
131133
132134 # Connect to Temporal server. Most users will use {Client.connect} instead of this directly. Parameters here match
133- # {Options} returned from {dup_options } by intention so options can be altered and splatted to create a new
135+ # {Options} returned from {options } by intention so options can be dup'd, altered, splatted to create a new
134136 # connection.
135137 #
136138 # @param target_host [String] +host:port+ for the Temporal server. For local development, this is often
@@ -146,7 +148,7 @@ def initialize(*, **kwargs)
146148 # @param identity [String] Identity for this client.
147149 # @param keep_alive [KeepAliveOptions] Keep-alive options for the client connection. Can be set to +nil+ to
148150 # disable.
149- # @param http_connect_proxy [HTTPConnectProxyOptions] Options for HTTP CONNECT proxy.
151+ # @param http_connect_proxy [HTTPConnectProxyOptions, nil ] Options for HTTP CONNECT proxy.
150152 # @param runtime [Runtime] Runtime for this client.
151153 # @param lazy_connect [Boolean] If true, there is no connection until the first call is attempted or a worker
152154 # is created with it. Clients from lazy connections cannot be used for workers if they have not performed a
@@ -176,7 +178,7 @@ def initialize(
176178 http_connect_proxy :,
177179 runtime :,
178180 lazy_connect :
179- )
181+ ) . freeze
180182 # Create core client now if not lazy
181183 _core_client unless lazy_connect
182184 # Create service instances
@@ -190,10 +192,9 @@ def target_host
190192 @options . target_host
191193 end
192194
193- # @return [Options] Shallow duplication of options for potential use in {initialize}. Note, this is shallow, so
194- # attributes like {Options.rpc_metadata} are not duplicated, but no mutations will apply.
195- def dup_options
196- @options . dup
195+ # @return [String] Client identity.
196+ def identity
197+ @options . identity
197198 end
198199
199200 # @return [Boolean] Whether this connection is connected. This is always `true` unless `lazy_connect` option was
@@ -237,10 +238,10 @@ def new_core_client
237238 if @options . tls
238239 options . tls = if @options . tls . is_a? ( TLSOptions )
239240 Internal ::Bridge ::Client ::TLSOptions . new (
240- client_cert : @options . tls . client_cert ,
241- client_private_key : @options . tls . client_private_key ,
242- server_root_ca_cert : @options . tls . server_root_ca_cert ,
243- domain : @options . tls . domain
241+ client_cert : @options . tls . client_cert , # steep:ignore
242+ client_private_key : @options . tls . client_private_key , # steep:ignore
243+ server_root_ca_cert : @options . tls . server_root_ca_cert , # steep:ignore
244+ domain : @options . tls . domain # steep:ignore
244245 )
245246 else
246247 Internal ::Bridge ::Client ::TLSOptions . new
0 commit comments