aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/notifications
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/notifications')
-rw-r--r--activesupport/lib/active_support/notifications/fanout.rb16
1 files changed, 10 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/notifications/fanout.rb b/activesupport/lib/active_support/notifications/fanout.rb
index 8ecafd2b2b..40d7501e1b 100644
--- a/activesupport/lib/active_support/notifications/fanout.rb
+++ b/activesupport/lib/active_support/notifications/fanout.rb
@@ -45,11 +45,15 @@ module ActiveSupport
end
module Subscribers # :nodoc:
- def self.new(pattern, block)
- if pattern
- TimedSubscriber.new pattern, block
+ def self.new(pattern, listener)
+ if listener.respond_to?(:call)
+ if pattern
+ TimedSubscriber.new pattern, listener
+ else
+ AllMessages.new pattern, listener
+ end
else
- AllMessages.new pattern, block
+ Subscriber.new pattern, listener
end
end
@@ -60,11 +64,11 @@ module ActiveSupport
end
def start(name, id, payload)
- raise NotImplementedError
+ @delegate.start name, id, payload
end
def finish(name, id, payload)
- raise NotImplementedError
+ @delegate.finish name, id, payload
end
def subscribed_to?(name)