On 21 Nov 2013, at 3:11 pm, johnrengelman <john.r.engel...@gmail.com> wrote:

> Hi all -
> I've been finding more and more reasons in our build in our build to create
> an implementation of java process forking. Currently the JavaExec
> implementation is synchronous and I'm looking at implementing some features
> that would allow a build to fork multiple processes and then blocking on
> joining them back together. I don't see any designDocs related to this (or
> to parallel task execution within a project) so I wonder if there is some
> thought already on this.
> 
> I have a working implementation that I want to extend into gradle core if
> possible. The simple API would be to add the following to Project:
> 
> ExecHandle javafork(Closure closure);
> ExecHandle fork(Closure closure);
> 
> Might also be useful to add the following:
> 
> ExecResult join(ExecHandle handle);
> List<ExecResult> join(List<ExecHandle> handles);
> 
> Any thoughts or suggestions?

ExecHandle is currently internal API, so at the least that would have to be 
addressed.

Another problem is that we are really reluctant to grow the Project API at all. 
We are working on a way to add new functionality like this, but it's not going 
to be available soon. It would be preferable to deliver this as a kind of 
extension library for the time being. It will have to use internal API so that 
does mean there may be versioning issues.

In my experience when working with async processes, you nearly always end up 
doing some pattern matching on the launched process for state control. It would 
be good to get some support for that in there too.

-- 
Luke Daley
Principal Engineer, Gradleware 
http://gradleware.com


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to