Method: ActiveSupport::Notifications.subscribed

Defined in:
lib/active_support/notifications.rb

.subscribed(callback, pattern = nil, monotonic: false, &block) ⇒ Object



242
243
244
245
246
247
# File 'lib/active_support/notifications.rb', line 242

def subscribed(callback, pattern = nil, monotonic: false, &block)
  subscriber = notifier.subscribe(pattern, callback, monotonic: monotonic)
  yield
ensure
  unsubscribe(subscriber)
end