diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-11-29 02:30:35 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-11-29 02:30:35 -0800 |
commit | 327545c3ae904d1a9c67de3e280c182ed6418023 (patch) | |
tree | 65954e8d5e2fdb1996ca82eb6f86f1c39e9ec865 /activesupport/test | |
parent | bb84cab2fceb470cd1e7fa1ceeb5e7c4c764f5de (diff) | |
download | rails-327545c3ae904d1a9c67de3e280c182ed6418023.tar.gz rails-327545c3ae904d1a9c67de3e280c182ed6418023.tar.bz2 rails-327545c3ae904d1a9c67de3e280c182ed6418023.zip |
Notifications: synchronous fanout queue pushes events to subscribers rather than having them concurrently pull
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/notifications_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/test/notifications_test.rb b/activesupport/test/notifications_test.rb index 93c61b2c83..4f880d0db7 100644 --- a/activesupport/test/notifications_test.rb +++ b/activesupport/test/notifications_test.rb @@ -71,6 +71,16 @@ module Notifications end end + class SyncPubSubTest < PubSubTest + def setup + Thread.abort_on_exception = true + + @notifier = ActiveSupport::Notifications::Notifier.new(ActiveSupport::Notifications::Fanout.new(true)) + @events = [] + @notifier.subscribe { |*args| @events << event(*args) } + end + end + class InstrumentationTest < TestCase def test_instrument_returns_block_result assert_equal 2, @notifier.instrument(:awesome) { 1 + 1 } |