[MacRuby-devel] [MacRuby] #476: GCD Groups should be a wrapper around dispatch, not its own invocation style
MacRuby
ruby-noreply at macosforge.org
Thu Dec 3 06:20:21 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 ernest.prabhakar@…):
Here's an alternative proposal that would probably be simpler to
implement:
group.for_queue(q).dispatch(sync) { block }
That is, group.dispatch would take a 'sync' parameter, just like
queue.dispatch. The default would be the default queue, but the group
would have an ivar representing the "current' queue. This provides
consistency while avoiding the need to always specify the sync to define a
queue.
Of course, the syntax is ugly, but this allows us to define a convenience
method on queue:
queue.for(group).dispatch(sync) { block }
That seems the most consistent with how dispatch works outside of groups,
and semantically cleaner. Thoughts?
--
Ticket URL: <http://www.macruby.org/trac/ticket/476#comment:1>
MacRuby <http://macruby.org/>
More information about the MacRuby-devel
mailing list