lib/celluloid/proxies/future_proxy.rb in celluloid-0.14.0 vs lib/celluloid/proxies/future_proxy.rb in celluloid-0.14.1.pre
- old
+ new
@@ -15,11 +15,19 @@
def method_missing(meth, *args, &block)
if block_given?
# FIXME: nicer exception
raise "Cannot use blocks with futures yet"
end
+
future = Future.new
- future.execute(@mailbox, meth, args, block)
+ call = SyncCall.new(future, meth, args, block)
+
+ begin
+ @mailbox << call
+ rescue MailboxError
+ raise DeadActorError, "attempted to call a dead actor"
+ end
+
future
end
end
end