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
-
#config ⇒ Configuration
(also: #configuration)
private
Returns the global configuration object.
-
#configure {|config| ... } ⇒ Configuration
private
Configures the gem with a block and validates after mutation.
-
#validate! ⇒ void
private
Validates the current configuration.
Instance Method Details
#config ⇒ Configuration 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.
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.
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.
50 51 52 |
# File 'lib/activejob/temporal/configurable.rb', line 50 def validate! config.validate! end |