Class: Liebre::Actor::Publisher::Reporter

Inherits:
Object
  • Object
show all
Defined in:
lib/liebre/actor/publisher/reporter.rb

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ Reporter

Returns a new instance of Reporter.



6
7
8
# File 'lib/liebre/actor/publisher/reporter.rb', line 6

def initialize context
  @context = context
end

Instance Method Details

#on_cleanObject



33
34
35
36
37
38
# File 'lib/liebre/actor/publisher/reporter.rb', line 33

def on_clean
  yield
rescue Exception => error
  logger.error("Error cleaning publisher: #{name}\n#{error.message}\n#{error.backtrace}")
  raise error
end

#on_publishObject



18
19
20
21
22
23
# File 'lib/liebre/actor/publisher/reporter.rb', line 18

def on_publish
  yield
rescue Exception => error
  logger.error("Error publising: #{name}\n#{error.message}\n#{error.backtrace}")
  raise error
end

#on_startObject



10
11
12
13
14
15
16
# File 'lib/liebre/actor/publisher/reporter.rb', line 10

def on_start
  yield
  logger.info("Publisher started: #{name}")
rescue Exception => error
  logger.error("Error starting publisher: #{name}\n#{error.message}\n#{error.backtrace}")
  raise error
end

#on_stopObject



25
26
27
28
29
30
31
# File 'lib/liebre/actor/publisher/reporter.rb', line 25

def on_stop
  yield
  logger.info("Publisher stopped: #{name}")
rescue Exception => error
  logger.error("Error stopping publisher: #{name}\n#{error.message}\n#{error.backtrace}")
  raise error
end