Skip to content
Browse files

Notifier API == Fanout API, so replace Notifier with Fanout as they q…

…uack the same
  • Loading branch information...
1 parent 234b969 commit b2c8a5fd3ea2268022915bb8a7ab449a1502b90d @tenderlove tenderlove committed
View
8 activesupport/lib/active_support/log_subscriber/test_helper.rb
@@ -33,7 +33,7 @@ class LogSubscriber
module TestHelper
def setup
@logger = MockLogger.new
- @notifier = ActiveSupport::Notifications::Notifier.new(queue)
+ @notifier = ActiveSupport::Notifications::Fanout.new
ActiveSupport::LogSubscriber.colorize_logging = false
@@ -81,10 +81,6 @@ def wait
def set_logger(logger)
ActiveSupport::LogSubscriber.logger = logger
end
-
- def queue
- ActiveSupport::Notifications::Fanout.new
- end
end
end
-end
+end
View
24 activesupport/lib/active_support/notifications.rb
@@ -47,34 +47,12 @@ class << self
delegate :instrument, :to => :instrumenter
def notifier
- @notifier ||= Notifier.new
+ @notifier ||= Fanout.new
end
def instrumenter
Thread.current[:"instrumentation_#{notifier.object_id}"] ||= Instrumenter.new(notifier)
end
end
-
- class Notifier
- def initialize(queue = Fanout.new)
- @queue = queue
- end
-
- def publish(*args)
- @queue.publish(*args)
- end
-
- def subscribe(pattern = nil, &block)
- @queue.subscribe(pattern, &block)
- end
-
- def unsubscribe(subscriber)
- @queue.unsubscribe(subscriber)
- end
-
- def wait
- @queue.wait
- end
- end
end
end

0 comments on commit b2c8a5f

Please sign in to comment.
Something went wrong with that request. Please try again.