Class: MarchHare::ShutdownListener
- Inherits:
-
Object
- Object
- MarchHare::ShutdownListener
- Defined in:
- lib/march_hare/shutdown_listener.rb
Instance Method Summary collapse
-
#initialize(entity, &block) ⇒ ShutdownListener
constructor
A new instance of ShutdownListener.
- #shutdown_completed(cause) ⇒ Object
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 |