Class: MarchHare::ShutdownListener

Inherits:
Object
  • Object
show all
Defined in:
lib/march_hare/shutdown_listener.rb

Instance Method Summary collapse

Constructor Details

#initialize(entity, &block) ⇒ ShutdownListener

Returns a new instance of ShutdownListener.



5
6
7
8
9
# File 'lib/march_hare/shutdown_listener.rb', line 5

def initialize(entity, &block)
  # connection or channel
  @entity = entity
  @block  = block
end

Instance Method Details

#shutdown_completed(cause) ⇒ Object



11
12
13
# File 'lib/march_hare/shutdown_listener.rb', line 11

def shutdown_completed(cause)
  @block.call(@entity, cause)
end