Skip to content
Browse files

Remove default at_exit handler, #67

  • Loading branch information...
1 parent 58cec77 commit 216187ea1753ea19379c95457f27bcfe9af6f96f @mperham committed Nov 8, 2012
Showing with 6 additions and 45 deletions.
  1. +3 −1 History.md
  2. +0 −7 lib/girl_friday.rb
  3. +0 −31 lib/girl_friday/monkey_patches.rb
  4. +1 −1 lib/girl_friday/version.rb
  5. +0 −1 test/helper.rb
  6. +0 −4 test/test_batch.rb
  7. +2 −0 test/test_girl_friday_queue.rb
View
4 History.md
@@ -4,7 +4,9 @@ Changes
HEAD
---------
-* Switch to Rubinius::Actor gem (jc00ke)
+* Remove old Rubinius 1.2.3 monkeypatches
+* Remove default `at_exit` handle which was causing issues [#67]
+* Support the rubinius-actor gem for jruby/rbx (jc00ke)
Avoids a nameclash for projects that define their own Actor class.
0.10.0
View
7 lib/girl_friday.rb
@@ -90,10 +90,3 @@ def self.shutdown!(timeout=30)
end
end
-
-
-unless defined?($testing)
- at_exit do
- GirlFriday.shutdown!
- end
-end
View
31 lib/girl_friday/monkey_patches.rb
@@ -1,31 +0,0 @@
-if RUBY_ENGINE == 'rbx' && (Rubinius::VERSION < '1.2.4' || Rubinius::VERSION == '1.2.4dev')
- puts "Loading rubinius actor monkeypatches" if $testing
- class Actor
-
- # Monkeypatch so this works with Rubinius 1.2.3 (latest).
- # 1.2.4 should have the necessary fix included.
- def notify_exited(actor, reason)
- exit_message = nil
- @lock.receive
- begin
- return self unless @alive
- @links.delete(actor)
- if @trap_exit
- exit_message = DeadActorError.new(actor, reason)
- elsif reason
- @interrupts << DeadActorError.new(actor, reason)
- if @filter
- @filter = nil
- @ready << nil
- end
- end
- ensure
- @lock << nil
- end
- send exit_message if exit_message
- self
- end
-
- end
-
-end
View
2 lib/girl_friday/version.rb
@@ -1,3 +1,3 @@
module GirlFriday
- VERSION = "0.10.0"
+ VERSION = "0.11.0"
end
View
1 test/helper.rb
@@ -1,4 +1,3 @@
-$testing = true
puts RUBY_DESCRIPTION
at_exit do
View
4 test/test_batch.rb
@@ -34,10 +34,6 @@ def test_batch_timeout
assert_equal 'x', results[1]
assert_nil results[2]
assert_equal 'x', results[3]
-
- # Necessary to work around a Ruby 1.9.2 bug
- # http://redmine.ruby-lang.org/issues/5342
- sleep 0.1
end
def test_empty_batch
View
2 test/test_girl_friday_queue.rb
@@ -182,6 +182,8 @@ def test_should_allow_graceful_shutdown
queue.push(:text => 'foo')
end
+ sleep 0.1
+
assert_equal 1, GirlFriday.queues.size
count = GirlFriday.shutdown!
assert_equal 0, count

0 comments on commit 216187e

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