aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-06-19 10:19:48 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2012-06-19 10:37:50 -0700
commit644a1796c67ed4d55e2d2ae7182a6a020350f13c (patch)
tree6a07bf20ccc937bcd1baac641f31d29a6cb5a692 /activesupport/lib/active_support
parente4de78aec504b885d40c0244ce3222c05ca3dc2e (diff)
downloadrails-644a1796c67ed4d55e2d2ae7182a6a020350f13c.tar.gz
rails-644a1796c67ed4d55e2d2ae7182a6a020350f13c.tar.bz2
rails-644a1796c67ed4d55e2d2ae7182a6a020350f13c.zip
remove global cache
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/notifications.rb9
1 files changed, 2 insertions, 7 deletions
diff --git a/activesupport/lib/active_support/notifications.rb b/activesupport/lib/active_support/notifications.rb
index 12bcd6d308..55041ea2af 100644
--- a/activesupport/lib/active_support/notifications.rb
+++ b/activesupport/lib/active_support/notifications.rb
@@ -135,8 +135,6 @@ module ActiveSupport
# to log subscribers in a thread. You can use any queue implementation you want.
#
module Notifications
- @instrumenters = Hash.new { |h,k| h[k] = notifier.listening?(k) }
-
class Registry # :nodoc:
def self.instance
Thread.current[name] ||= new
@@ -160,7 +158,7 @@ module ActiveSupport
end
def instrument(name, payload = {})
- if @instrumenters[name]
+ if notifier.listening?(name)
instrumenter.instrument(name, payload) { yield payload if block_given? }
else
yield payload if block_given?
@@ -168,9 +166,7 @@ module ActiveSupport
end
def subscribe(*args, &block)
- notifier.subscribe(*args, &block).tap do
- @instrumenters.clear
- end
+ notifier.subscribe(*args, &block)
end
def subscribed(callback, *args, &block)
@@ -182,7 +178,6 @@ module ActiveSupport
def unsubscribe(args)
notifier.unsubscribe(args)
- @instrumenters.clear
end
def instrumenter