Module: ActiveJob::Temporal::Configurable Private

Included in:
ActiveJob::Temporal
Defined in:
lib/activejob/temporal/configurable.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Module-level configuration API for ActiveJob::Temporal.

Instance Method Summary collapse

Instance Method Details

#configConfiguration Also known as: 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 the global configuration object.

Returns:



16
17
18
19
# File 'lib/activejob/temporal/configurable.rb', line 16

def config
  @config_mvar ||= Concurrent::MVar.new(Configuration.new)
  @config_mvar.value
end

#configure {|config| ... } ⇒ 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.

Configures the gem with a block and validates before publishing changes.

Yields:

  • (config)

    Gives the configuration object to the block

Yield Parameters:

Returns:

Raises:



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/activejob/temporal/configurable.rb', line 28

def configure(&block)
  return config unless block

  @config_mvar ||= Concurrent::MVar.new(Configuration.new)
  applied_configuration = nil

  @config_mvar.modify do |current_configuration|
    applied_configuration = build_configuration_candidate(current_configuration, &block)
  end

  applied_configuration
end

#validate!void

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.

This method returns an undefined value.

Validates the current configuration.

Raises:



45
46
47
# File 'lib/activejob/temporal/configurable.rb', line 45

def validate!
  config.validate!
end