Class: RailsTransactionalOutbox::Monitor
- Inherits:
-
Dry::Monitor::Notifications
- Object
- Dry::Monitor::Notifications
- RailsTransactionalOutbox::Monitor
- Defined in:
- lib/rails_transactional_outbox/monitor.rb
Defined Under Namespace
Classes: UnknownEventError
Instance Method Summary collapse
- #events ⇒ Object
-
#initialize ⇒ Monitor
constructor
A new instance of Monitor.
- #subscribe(event) ⇒ Object
Constructor Details
#initialize ⇒ Monitor
Returns a new instance of Monitor.
17 18 19 20 |
# File 'lib/rails_transactional_outbox/monitor.rb', line 17 def initialize super(:rails_transactional_outbox) EVENTS.each { |event| register_event(event) } end |
Instance Method Details
#events ⇒ Object
28 29 30 |
# File 'lib/rails_transactional_outbox/monitor.rb', line 28 def events EVENTS end |
#subscribe(event) ⇒ Object
22 23 24 25 26 |
# File 'lib/rails_transactional_outbox/monitor.rb', line 22 def subscribe(event) return super if events.include?(event.to_s) raise UnknownEventError.new(events, event) end |