Class: TCB::OutboxRelay
- Inherits:
-
Object
- Object
- TCB::OutboxRelay
- Defined in:
- lib/tcb/outbox_relay.rb
Instance Method Summary collapse
-
#initialize(outbox_store:, event_store:, lock_timeout:) ⇒ OutboxRelay
constructor
A new instance of OutboxRelay.
- #run ⇒ Object
Constructor Details
#initialize(outbox_store:, event_store:, lock_timeout:) ⇒ OutboxRelay
Returns a new instance of OutboxRelay.
5 6 7 8 9 |
# File 'lib/tcb/outbox_relay.rb', line 5 def initialize(outbox_store:, event_store:, lock_timeout:) @outbox_store = outbox_store @event_store = event_store @lock_timeout = lock_timeout end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 |
# File 'lib/tcb/outbox_relay.rb', line 11 def run recover_stale_locks entries = lock_pending envelopes = fetch_envelopes(entries) entries.each { |entry| process(entry, envelopes[entry.event_id]) } end |