[macruby-changes] [3559] MacRuby/trunk/lib/dispatch/future.rb
source_changes at macosforge.org
source_changes at macosforge.org
Tue Feb 16 17:46:38 PST 2010
Revision: 3559
http://trac.macosforge.org/projects/ruby/changeset/3559
Author: ernest.prabhakar at gmail.com
Date: 2010-02-16 17:46:38 -0800 (Tue, 16 Feb 2010)
Log Message:
-----------
Make Dispatch::Future#join match Group and documentation
Modified Paths:
--------------
MacRuby/trunk/lib/dispatch/future.rb
Modified: MacRuby/trunk/lib/dispatch/future.rb
===================================================================
--- MacRuby/trunk/lib/dispatch/future.rb 2010-02-17 01:46:31 UTC (rev 3558)
+++ MacRuby/trunk/lib/dispatch/future.rb 2010-02-17 01:46:38 UTC (rev 3559)
@@ -11,13 +11,12 @@
def initialize(priority = nil, &block)
@value = nil
- @group = Group.new
- Dispatch.group(@group, priority) { @value = block.call }
+ @group = Dispatch.group(nil, priority) { @value = block.call }
end
- # Waits for the computation to finish
- def join
- group.wait
+ # Waits for the computation to finish, or calls block (if present) when done
+ def join(&block)
+ group.join(&block)
end
# Joins, then returns the value
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100216/29e40f31/attachment.html>
More information about the macruby-changes
mailing list