Class: StagedEvent::PublisherProcess
- Inherits:
-
Object
- Object
- StagedEvent::PublisherProcess
- Includes:
- Technologic
- Defined in:
- lib/staged_event/publisher_process.rb
Instance Method Summary collapse
-
#initialize(publisher) ⇒ PublisherProcess
constructor
A new instance of PublisherProcess.
- #run ⇒ Object
Constructor Details
#initialize(publisher) ⇒ PublisherProcess
Returns a new instance of PublisherProcess.
7 8 9 10 |
# File 'lib/staged_event/publisher_process.rb', line 7 def initialize(publisher) @publisher = publisher @backoff_timer = BackoffTimer.new end |
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/staged_event/publisher_process.rb', line 12 def run loop do sleep(backoff_timer.value) publish_next_batch end rescue StandardError => exception error :publish_failed, exception: exception. backoff_timer.increment retry rescue SignalException => exception error :signal_exception, message: exception. end |