Class: ActiveJob::Temporal::Configuration Private
- Inherits:
-
Object
- Object
- ActiveJob::Temporal::Configuration
- Defined in:
- lib/activejob/temporal/configuration.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Thread Safety The global configuration object is synchronized by Configurable while configure blocks mutate it. Complete configuration during application boot.
Environment Variable Defaults ACTIVEJOB_TEMPORAL_TARGET, ACTIVEJOB_TEMPORAL_NAMESPACE, ACTIVEJOB_TEMPORAL_TASK_QUEUE_PREFIX, ACTIVEJOB_TEMPORAL_TASK_QUEUE, ACTIVEJOB_TEMPORAL_MAX_PAYLOAD_SIZE_KB, ACTIVEJOB_TEMPORAL_MAX_CONCURRENT_ACTIVITIES, ACTIVEJOB_TEMPORAL_MAX_CONCURRENT_WORKFLOW_TASKS, can provide defaults.
Configuration object for the activejob-temporal gem.
Holds connection settings, timeouts, retry policies, and operational flags. Use configure to set values with automatic validation.
Instance Attribute Summary collapse
- #in_configure_block ⇒ Object private
Class Method Summary collapse
Instance Method Summary collapse
- #[](key) ⇒ Object private
- #[]=(key, value) ⇒ Object private
- #add_middleware(middleware) ⇒ Object private
-
#initialize ⇒ Configuration
constructor
private
A new instance of Configuration.
- #validate! ⇒ Object private
Constructor Details
#initialize ⇒ Configuration
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Configuration.
389 390 391 392 393 394 395 |
# File 'lib/activejob/temporal/configuration.rb', line 389 def initialize @attributes = {} @in_configure_block = false CONFIGURATION_ATTRIBUTES.each do |attribute, | @attributes[attribute] = resolve_default_value() end end |
Instance Attribute Details
#in_configure_block ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
375 376 377 |
# File 'lib/activejob/temporal/configuration.rb', line 375 def in_configure_block @in_configure_block end |
Class Method Details
.format_validation_errors(errors) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
418 419 420 421 422 423 424 425 426 427 428 |
# File 'lib/activejob/temporal/configuration.rb', line 418 def self.format_validation_errors(errors) = errors. return .first if .size == 1 error_list = .each_with_index.map do |, index| " #{index + 1}. #{}" end.join("\n") plural = "s" if .size > 1 "Configuration validation failed with #{.size} error#{plural}:\n#{error_list}" end |
Instance Method Details
#[](key) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
397 398 399 |
# File 'lib/activejob/temporal/configuration.rb', line 397 def [](key) @attributes[key] end |
#[]=(key, value) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
401 402 403 |
# File 'lib/activejob/temporal/configuration.rb', line 401 def []=(key, value) @attributes[key] = value end |
#add_middleware(middleware) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
405 406 407 |
# File 'lib/activejob/temporal/configuration.rb', line 405 def add_middleware(middleware, ...) middleware_chain.add(middleware, ...) end |
#validate! ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
409 410 411 412 413 414 415 416 |
# File 'lib/activejob/temporal/configuration.rb', line 409 def validate! return if validation_level == :none validator = build_validator return if validator.valid? handle_validation_errors(validator.errors) end |