Class: StagedEvent::SubscriberProcess

Inherits:
Object
  • Object
show all
Includes:
Technologic
Defined in:
lib/staged_event/subscriber_process.rb

Instance Method Summary collapse

Constructor Details

#initialize(subscriber) ⇒ SubscriberProcess

Returns a new instance of SubscriberProcess.



7
8
9
# File 'lib/staged_event/subscriber_process.rb', line 7

def initialize(subscriber)
  @subscriber = subscriber
end

Instance Method Details

#runObject



11
12
13
14
15
16
17
18
# File 'lib/staged_event/subscriber_process.rb', line 11

def run
  subscriber.receive_events
rescue StandardError => exception
  error :subscriber_main_loop_failed, exception: exception.message
  retry
rescue SignalException => exception
  error :signal_exception, message: exception.message
end