Module: ActiveJob::Temporal::Client
- Defined in:
- lib/activejob/temporal/client.rb
Overview
TLS Configuration Precedence ‘config.tls` takes precedence, followed by configured certificate file paths, then legacy environment variables.
Environment Variables
-
TEMPORAL_TLS_CERT: TLS certificate (PEM format, full content)
-
TEMPORAL_TLS_KEY: TLS private key (PEM format, full content)
-
TEMPORAL_TLS_SERVER_NAME: TLS server name for verification
Builds Temporal client connections.
This module encapsulates the logic for connecting to a Temporal cluster with optional TLS configuration. TLS options can be provided via configuration attributes or environment variables.
Constant Summary collapse
- TLS_OPTIONS_CLASS =
if defined?(Temporalio::Client::Connection::TLSOptions) Temporalio::Client::Connection::TLSOptions end
- TLS_CERT_ENV =
Environment variable name for TLS certificate
"TEMPORAL_TLS_CERT"- TLS_KEY_ENV =
Environment variable name for TLS private key
"TEMPORAL_TLS_KEY"- TLS_SERVER_NAME_ENV =
Environment variable name for TLS server name
"TEMPORAL_TLS_SERVER_NAME"- TLS_SERVER_ROOT_CA_CERT_ENV =
Environment variable name for TLS root CA certificate
"TEMPORAL_TLS_SERVER_ROOT_CA_CERT"
Class Method Summary collapse
-
.build(configuration) ⇒ Temporalio::Client
Builds and connects a Temporal client.
Class Method Details
.build(configuration) ⇒ Temporalio::Client
Builds and connects a Temporal client.
Creates a new Temporalio::Client instance connected to the configured Temporal cluster. TLS options are automatically included if present in configuration or environment variables.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/activejob/temporal/client.rb', line 102 def build(configuration) Temporalio::Client.connect( configuration.target, configuration.namespace, **connection_kwargs(configuration) ) rescue StandardError => e raise ActiveJob::Temporal::Error, format( "Unable to connect to Temporal at %<target>s (namespace: %<namespace>s): %<error>s", target: configuration.target, namespace: configuration.namespace, error: e. ) end |