1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Notifier API == Fanout API, so replace Notifier with Fanout as they quack the same

This commit is contained in:
Aaron Patterson 2010-07-18 16:49:29 -07:00
parent 234b969946
commit b2c8a5fd3e
2 changed files with 3 additions and 29 deletions

View file

@ -33,7 +33,7 @@ module ActiveSupport
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 @@ module ActiveSupport
def set_logger(logger)
ActiveSupport::LogSubscriber.logger = logger
end
def queue
ActiveSupport::Notifications::Fanout.new
end
end
end
end

View file

@ -47,34 +47,12 @@ module ActiveSupport
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