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 after mutation.

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
40
41
42
43
44
# File 'lib/activejob/temporal/configurable.rb', line 28

def configure
  return config unless block_given?

  @config_mvar ||= Concurrent::MVar.new(Configuration.new)
  @config_mvar.borrow do |configuration|
    configuration.in_configure_block = true

    begin
      yield(configuration)
    ensure
      configuration.in_configure_block = false
    end

    configuration.validate!
    configuration
  end
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:



50
51
52
# File 'lib/activejob/temporal/configurable.rb', line 50

def validate!
  config.validate!
end