Class: TransactionalOutbox::Relay::EventProcessor
- Inherits:
-
Object
- Object
- TransactionalOutbox::Relay::EventProcessor
- Defined in:
- lib/transactional_outbox/relay/event_processor.rb
Instance Attribute Summary collapse
-
#db ⇒ Object
readonly
Returns the value of attribute db.
-
#producer ⇒ Object
readonly
Returns the value of attribute producer.
-
#queue ⇒ Object
readonly
Returns the value of attribute queue.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(queue, producer) ⇒ EventProcessor
constructor
A new instance of EventProcessor.
Constructor Details
#initialize(queue, producer) ⇒ EventProcessor
Returns a new instance of EventProcessor.
8 9 10 11 12 |
# File 'lib/transactional_outbox/relay/event_processor.rb', line 8 def initialize(queue, producer) @queue = queue @db = TransactionalOutbox::Database.new @producer = producer end |
Instance Attribute Details
#db ⇒ Object (readonly)
Returns the value of attribute db.
6 7 8 |
# File 'lib/transactional_outbox/relay/event_processor.rb', line 6 def db @db end |
#producer ⇒ Object (readonly)
Returns the value of attribute producer.
6 7 8 |
# File 'lib/transactional_outbox/relay/event_processor.rb', line 6 def producer @producer end |
#queue ⇒ Object (readonly)
Returns the value of attribute queue.
6 7 8 |
# File 'lib/transactional_outbox/relay/event_processor.rb', line 6 def queue @queue end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/transactional_outbox/relay/event_processor.rb', line 14 def call process rescue StandardError => e TransactionalOutbox::Relay.monitor.publish( TransactionalOutbox::WORKER_EXCEPTIONS_TOTAL_MONITOR_EVENT, { queue:, exception: e.class.to_s } ) resolve_failover.call(e, @events) end |