Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Max concurrent asynchronous processes #1

Open
johnrengelman opened this issue Dec 5, 2013 · 0 comments
Open

Max concurrent asynchronous processes #1

johnrengelman opened this issue Dec 5, 2013 · 0 comments
Milestone

Comments

@johnrengelman
Copy link
Owner

Implement an ability to configure a max # of concurrent processes. This should work something like a thread executor (in fact could probably be implemented as such).

The idea here is that the build may submit N processes to be executed, but Gradle will only execute M processes at a time. As a processes completes, it's return/execution result is stored and a new process is grab from the queue and executed until there are no more remaining.

The API to to build should not change. Normal forking and joining should exist.

def procs = (1..10).each {
  project.procs.fork {
    <some processes>
  }
}
project.procs.waitForFinish(procs)

Requesting execution of the processes should return immediately, even if the process in queued for execution. This will likely require a new implementation of ProcessHandle since the a concrete process won't exist yet for those queued.

Additionally waiting for completion of queued processes should wait for only those processes to be drained from the queue.

THOUGHT Should any credence be placed on ordering of the processes within the queue? Do we need a priority? Should processes that are being waited on have precedence to be popped from the queue ahead of those not being waited on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant