Class: Circuitbox::Notifier::ActiveSupport

Inherits:
Object
  • Object
show all
Defined in:
lib/circuitbox/notifier/active_support.rb

Instance Method Summary collapse

Instance Method Details

#notify(circuit_name, event) ⇒ Object



6
7
8
# File 'lib/circuitbox/notifier/active_support.rb', line 6

def notify(circuit_name, event)
  ::ActiveSupport::Notifications.instrument("#{event}.circuitbox", circuit: circuit_name)
end

#notify_run(circuit_name, &block) ⇒ Object



14
15
16
# File 'lib/circuitbox/notifier/active_support.rb', line 14

def notify_run(circuit_name, &block)
  ::ActiveSupport::Notifications.instrument('run.circuitbox', circuit: circuit_name, &block)
end

#notify_warning(circuit_name, message) ⇒ Object



10
11
12
# File 'lib/circuitbox/notifier/active_support.rb', line 10

def notify_warning(circuit_name, message)
  ::ActiveSupport::Notifications.instrument('warning.circuitbox', circuit: circuit_name, message: message)
end