aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/notifications.rb14
1 files changed, 6 insertions, 8 deletions
diff --git a/activesupport/lib/active_support/notifications.rb b/activesupport/lib/active_support/notifications.rb
index d9bfcbfcab..3e96decb8c 100644
--- a/activesupport/lib/active_support/notifications.rb
+++ b/activesupport/lib/active_support/notifications.rb
@@ -44,11 +44,16 @@ module ActiveSupport
class << self
attr_writer :notifier
- delegate :publish, :subscribe, :instrument, :to => :notifier
+ delegate :publish, :subscribe, :to => :notifier
+ delegate :instrument, :to => :instrumenter
def notifier
@notifier ||= Notifier.new
end
+
+ def instrumenter
+ Thread.current[:"instrumentation_#{notifier.object_id}"] ||= Instrumenter.new(notifier)
+ end
end
class Notifier
@@ -67,13 +72,6 @@ module ActiveSupport
def wait
@queue.wait
end
-
- delegate :instrument, :to => :current_instrumenter
-
- private
- def current_instrumenter
- Thread.current[:"instrumentation_#{object_id}"] ||= Notifications::Instrumenter.new(self)
- end
end
end
end