lib/celluloid/io/mailbox.rb in celluloid-0.5.0 vs lib/celluloid/io/mailbox.rb in celluloid-0.6.0
- old
+ new
@@ -2,11 +2,11 @@
module Celluloid
module IO
# An alternative implementation of Celluloid::Mailbox using Wakers
class Mailbox < Celluloid::Mailbox
- attr_reader :reactor
+ attr_reader :reactor, :waker
def initialize
@messages = []
@lock = Mutex.new
@waker = Waker.new
@@ -48,10 +48,10 @@
message = next_message(&block)
end
end until message
message
- rescue DeadWakerError
+ rescue IOError, DeadWakerError
shutdown # force shutdown of the mailbox
raise MailboxShutdown, "mailbox shutdown called during receive"
end
# Cleanup any IO objects this Mailbox may be using