Class: NtiEventBus::Configuration
- Inherits:
-
Object
- Object
- NtiEventBus::Configuration
- Defined in:
- lib/nti_event_bus/configuration.rb
Overview
Runtime configuration. On Rails the Railtie fills in path defaults; hosts may override any of it.
Instance Attribute Summary collapse
-
#dispatcher ⇒ Object
Object responding to
#call(handler_name, payload). -
#events_dir ⇒ Object
Absolute path to the directory that
drawresolves nested event files from (e.g. config/events). -
#logger ⇒ Object
Optional logger; when set, receives debug lines from the bus.
-
#queue_name ⇒ Object
ActiveJob queue used by the default dispatcher.
-
#root_events_file ⇒ Object
Absolute path to the root events file that is evaluated by
setup!(e.g. config/events.rb).
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #root_events_file! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
17 18 19 20 21 22 23 |
# File 'lib/nti_event_bus/configuration.rb', line 17 def initialize @queue_name = :events @root_events_file = nil @events_dir = nil @logger = nil @dispatcher = nil end |
Instance Attribute Details
#dispatcher ⇒ Object
Object responding to #call(handler_name, payload). Defaults to asynchronous ActiveJob dispatch.
26 27 28 |
# File 'lib/nti_event_bus/configuration.rb', line 26 def dispatcher @dispatcher ||= Dispatchers::ActiveJob.new end |
#events_dir ⇒ Object
Absolute path to the directory that draw resolves nested event files from (e.g. config/events).
9 10 11 |
# File 'lib/nti_event_bus/configuration.rb', line 9 def events_dir @events_dir end |
#logger ⇒ Object
Optional logger; when set, receives debug lines from the bus.
13 14 15 |
# File 'lib/nti_event_bus/configuration.rb', line 13 def logger @logger end |
#queue_name ⇒ Object
ActiveJob queue used by the default dispatcher.
11 12 13 |
# File 'lib/nti_event_bus/configuration.rb', line 11 def queue_name @queue_name end |
#root_events_file ⇒ Object
Absolute path to the root events file that is evaluated by setup! (e.g. config/events.rb).
7 8 9 |
# File 'lib/nti_event_bus/configuration.rb', line 7 def root_events_file @root_events_file end |
Instance Method Details
#root_events_file! ⇒ Object
30 31 32 33 |
# File 'lib/nti_event_bus/configuration.rb', line 30 def root_events_file! root_events_file || raise(NotConfiguredError, 'NtiEventBus.configuration.root_events_file must be set') end |