Class: AllMyCircuits::Notifiers::AbstractNotifier

Inherits:
Object
  • Object
show all
Defined in:
lib/all_my_circuits/notifiers/abstract_notifier.rb

Overview

Public: notifies some service about change of breaker’s state. For example, one could send a Librato metric whenever a circuit breaker is opened or closed.

Direct Known Subclasses

NullNotifier

Instance Method Summary collapse

Constructor Details

#initialize(breaker_name, **kwargs) ⇒ AbstractNotifier

Returns a new instance of AbstractNotifier.



9
10
11
# File 'lib/all_my_circuits/notifiers/abstract_notifier.rb', line 9

def initialize(breaker_name, **kwargs)
  @breaker_name = breaker_name
end

Instance Method Details

#closedObject

Public: called once the circuit is closed.

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/all_my_circuits/notifiers/abstract_notifier.rb', line 21

def closed
  raise NotImplementedError
end

#openedObject

Public: called once the circuit is tripped open.

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/all_my_circuits/notifiers/abstract_notifier.rb', line 15

def opened
  raise NotImplementedError
end