Class: Euston::Daemons::Pipeline::DaemonEnvironment
- Inherits:
-
Euston::DaemonEnvironment
- Object
- Euston::DaemonEnvironment
- Euston::Daemons::Pipeline::DaemonEnvironment
- Defined in:
- lib/euston-daemons/pipeline/config/environment.rb
Class Attribute Summary collapse
-
.command_handler_namespaces ⇒ Object
Returns the value of attribute command_handler_namespaces.
-
.command_log_ignores ⇒ Object
Returns the value of attribute command_log_ignores.
-
.command_loggers ⇒ Object
Returns the value of attribute command_loggers.
-
.command_processors ⇒ Object
Returns the value of attribute command_processors.
-
.event_handler_namespaces ⇒ Object
Returns the value of attribute event_handler_namespaces.
-
.event_processors ⇒ Object
Returns the value of attribute event_processors.
-
.event_store_dispatcher_wait_time ⇒ Object
Returns the value of attribute event_store_dispatcher_wait_time.
-
.event_store_dispatchers ⇒ Object
Returns the value of attribute event_store_dispatchers.
-
.message_buffer_wait_time ⇒ Object
Returns the value of attribute message_buffer_wait_time.
-
.message_buffers ⇒ Object
Returns the value of attribute message_buffers.
-
.snapshot_threshold ⇒ Object
Returns the value of attribute snapshot_threshold.
-
.snapshotter_wait_time ⇒ Object
Returns the value of attribute snapshotter_wait_time.
-
.snapshotters ⇒ Object
Returns the value of attribute snapshotters.
-
.user_defined_components ⇒ Object
Returns the value of attribute user_defined_components.
Instance Method Summary collapse
-
#initialize(data) ⇒ DaemonEnvironment
constructor
A new instance of DaemonEnvironment.
- #setup ⇒ Object
Constructor Details
#initialize(data) ⇒ DaemonEnvironment
Returns a new instance of DaemonEnvironment.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/euston-daemons/pipeline/config/environment.rb', line 40 def initialize data @logger = data[:logger] @daemon_config = data[:daemon_config] if data.has_key?(:app_root) && @daemon_config.has_key?(:i18n_locales_path) @i18n_locales_path = File.join(data[:app_root], @daemon_config[:i18n_locales_path], "*") end @amqp_config = ErbYaml.read data[:amqp_config_path], data[:environment] @mongo_config = ErbYaml.read data[:mongo_config_path], data[:environment] self.class.command_handler_namespaces = data[:command_handler_namespaces] self.class.event_handler_namespaces = data[:event_handler_namespaces] self.class.user_defined_components = data[:user_defined_components] self.class.command_processors = @daemon_config[:command_processors].to_i self.class.command_loggers = @daemon_config[:command_loggers].to_i self.class.command_log_ignores = @daemon_config[:command_log_ignores] self.class.event_processors = @daemon_config[:event_processors].to_i self.class.event_store_dispatchers = @daemon_config[:event_store_dispatchers].to_i self.class.event_store_dispatcher_wait_time = @daemon_config[:event_store_dispatcher_wait_time].to_f self.class. = @daemon_config[:message_buffers].to_i self.class. = @daemon_config[:message_buffer_wait_time].to_f self.class.snapshotters = @daemon_config[:snapshotters].to_i self.class.snapshotter_wait_time = @daemon_config[:snapshotter_wait_time].to_f self.class.snapshot_threshold = @daemon_config[:snapshot_threshold].to_i end |
Class Attribute Details
.command_handler_namespaces ⇒ Object
Returns the value of attribute command_handler_namespaces.
24 25 26 |
# File 'lib/euston-daemons/pipeline/config/environment.rb', line 24 def command_handler_namespaces @command_handler_namespaces end |
.command_log_ignores ⇒ Object
Returns the value of attribute command_log_ignores.
24 25 26 |
# File 'lib/euston-daemons/pipeline/config/environment.rb', line 24 def command_log_ignores @command_log_ignores end |
.command_loggers ⇒ Object
Returns the value of attribute command_loggers.
24 25 26 |
# File 'lib/euston-daemons/pipeline/config/environment.rb', line 24 def command_loggers @command_loggers end |
.command_processors ⇒ Object
Returns the value of attribute command_processors.
24 25 26 |
# File 'lib/euston-daemons/pipeline/config/environment.rb', line 24 def command_processors @command_processors end |
.event_handler_namespaces ⇒ Object
Returns the value of attribute event_handler_namespaces.
24 25 26 |
# File 'lib/euston-daemons/pipeline/config/environment.rb', line 24 def event_handler_namespaces @event_handler_namespaces end |
.event_processors ⇒ Object
Returns the value of attribute event_processors.
24 25 26 |
# File 'lib/euston-daemons/pipeline/config/environment.rb', line 24 def event_processors @event_processors end |
.event_store_dispatcher_wait_time ⇒ Object
Returns the value of attribute event_store_dispatcher_wait_time.
24 25 26 |
# File 'lib/euston-daemons/pipeline/config/environment.rb', line 24 def event_store_dispatcher_wait_time @event_store_dispatcher_wait_time end |
.event_store_dispatchers ⇒ Object
Returns the value of attribute event_store_dispatchers.
24 25 26 |
# File 'lib/euston-daemons/pipeline/config/environment.rb', line 24 def event_store_dispatchers @event_store_dispatchers end |
.message_buffer_wait_time ⇒ Object
Returns the value of attribute message_buffer_wait_time.
24 25 26 |
# File 'lib/euston-daemons/pipeline/config/environment.rb', line 24 def @message_buffer_wait_time end |
.message_buffers ⇒ Object
Returns the value of attribute message_buffers.
24 25 26 |
# File 'lib/euston-daemons/pipeline/config/environment.rb', line 24 def @message_buffers end |
.snapshot_threshold ⇒ Object
Returns the value of attribute snapshot_threshold.
24 25 26 |
# File 'lib/euston-daemons/pipeline/config/environment.rb', line 24 def snapshot_threshold @snapshot_threshold end |
.snapshotter_wait_time ⇒ Object
Returns the value of attribute snapshotter_wait_time.
24 25 26 |
# File 'lib/euston-daemons/pipeline/config/environment.rb', line 24 def snapshotter_wait_time @snapshotter_wait_time end |
.snapshotters ⇒ Object
Returns the value of attribute snapshotters.
24 25 26 |
# File 'lib/euston-daemons/pipeline/config/environment.rb', line 24 def snapshotters @snapshotters end |
.user_defined_components ⇒ Object
Returns the value of attribute user_defined_components.
24 25 26 |
# File 'lib/euston-daemons/pipeline/config/environment.rb', line 24 def user_defined_components @user_defined_components end |
Instance Method Details
#setup ⇒ Object
67 68 69 70 71 72 73 74 75 76 |
# File 'lib/euston-daemons/pipeline/config/environment.rb', line 67 def setup setup_safely @daemon_config[:hoptoad_key] setup_amqp @amqp_config setup_mongo @mongo_config setup_euston @mongo_config[:event_store_database] I18n.load_path += Dir.glob(@i18n_locales_path) unless @i18n_locales_path.nil? self.class end |