Class: MarchHare::ShutdownListener

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

Instance Method Summary (collapse)

Constructor Details

- (ShutdownListener) initialize(entity)

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

- (Object) shutdown_completed(cause)



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

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