7474)
7575from temporalio .service import (
7676 ConnectConfig ,
77+ DnsLoadBalancingConfig ,
7778 HttpConnectProxyConfig ,
7879 KeepAliveConfig ,
7980 RetryConfig ,
@@ -139,6 +140,8 @@ async def connect(
139140 lazy : bool = False ,
140141 runtime : temporalio .runtime .Runtime | None = None ,
141142 http_connect_proxy_config : HttpConnectProxyConfig | None = None ,
143+ dns_load_balancing_config : DnsLoadBalancingConfig
144+ | None = DnsLoadBalancingConfig .default ,
142145 header_codec_behavior : HeaderCodecBehavior = HeaderCodecBehavior .NO_CODEC ,
143146 ) -> Self :
144147 """Connect to a Temporal server.
@@ -194,6 +197,11 @@ async def connect(
194197 used for workers.
195198 runtime: The runtime for this client, or the default if unset.
196199 http_connect_proxy_config: Configuration for HTTP CONNECT proxy.
200+ dns_load_balancing_config: DNS load balancing configuration for the
201+ client connection. Default is to re-resolve DNS every 30s. Can
202+ be set to ``None`` to disable. Silently disabled when
203+ ``http_connect_proxy_config`` is set, since the two are mutually
204+ exclusive.
197205 header_codec_behavior: Encoding behavior for headers sent by the client.
198206 """
199207 connect_config = temporalio .service .ConnectConfig (
@@ -207,6 +215,7 @@ async def connect(
207215 lazy = lazy ,
208216 runtime = runtime ,
209217 http_connect_proxy_config = http_connect_proxy_config ,
218+ dns_load_balancing_config = dns_load_balancing_config ,
210219 )
211220
212221 def make_lambda (
@@ -2873,6 +2882,7 @@ class ClientConnectConfig(TypedDict, total=False):
28732882 lazy : bool
28742883 runtime : temporalio .runtime .Runtime | None
28752884 http_connect_proxy_config : HttpConnectProxyConfig | None
2885+ dns_load_balancing_config : DnsLoadBalancingConfig | None
28762886 header_codec_behavior : HeaderCodecBehavior
28772887
28782888
@@ -9774,6 +9784,7 @@ async def connect(
97749784 lazy : bool = False ,
97759785 runtime : temporalio .runtime .Runtime | None = None ,
97769786 http_connect_proxy_config : HttpConnectProxyConfig | None = None ,
9787+ dns_load_balancing_config : DnsLoadBalancingConfig | None = None ,
97779788 ) -> CloudOperationsClient :
97789789 """Connect to a Temporal Cloud Operations API.
97799790
@@ -9810,6 +9821,10 @@ async def connect(
98109821 used for workers.
98119822 runtime: The runtime for this client, or the default if unset.
98129823 http_connect_proxy_config: Configuration for HTTP CONNECT proxy.
9824+ dns_load_balancing_config: DNS load balancing configuration for the
9825+ client connection. Default is disabled. Silently disabled when
9826+ ``http_connect_proxy_config`` is set, since the two are mutually
9827+ exclusive.
98139828 """
98149829 # Add version if given
98159830 if version :
@@ -9826,6 +9841,7 @@ async def connect(
98269841 lazy = lazy ,
98279842 runtime = runtime ,
98289843 http_connect_proxy_config = http_connect_proxy_config ,
9844+ dns_load_balancing_config = dns_load_balancing_config ,
98299845 )
98309846 return CloudOperationsClient (
98319847 await temporalio .service .ServiceClient .connect (connect_config )
0 commit comments