[MacRuby-devel] [MacRuby] #476: GCD Groups should be a wrapper around dispatch, not its own invocation style

MacRuby ruby-noreply at macosforge.org
Mon Dec 7 16:35:23 PST 2009


#476: GCD Groups should be a wrapper around dispatch, not its own invocation
style
----------------------------------------+-----------------------------------
 Reporter:  ernest.prabhakar@…          |       Owner:  lsansonetti@…        
     Type:  enhancement                 |      Status:  new                  
 Priority:  blocker                     |   Milestone:  MacRuby 0.5          
Component:  MacRuby                     |    Keywords:  gcd                  
----------------------------------------+-----------------------------------

Comment(by conradwt@…):

 After reading through the specification, I would like to see the following
 more explicit API:

 {{{
 queue = Dispatch::Queue.new( "comp.lang.MyCustomerQueue", attribute = nil
 )
 queue.dispatch_async( &block )
 queue.dispatch_sync( &block )
 queue.dispatch_apply( iterations, &block )

 group = Dispatch::Group.new
 group.dispatch_async( queue, &block )
 group.dispatch_wait( Dispatch::TIME_FOREVER )
 group.dispatch_release
 }}}

 These are just some of my thoughts because I was looking for something
 that was inline with the C API.  Also, the explicit API eliminates the
 need for 'if' constructs within
 the function definition within 'gcd.c'.  Next, we can namespace this by
 adding both the Group and Queue classes within the module Dispatch.

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/476#comment:8>
MacRuby <http://macruby.org/>



More information about the MacRuby-devel mailing list