Named
@Incubating public interface SharedResource extends Named
Task
.
Shared resources limit task execution concurrency. A shared resource has a defined number of leases. Tasks may declare that they
require 1 or more leases of a shared resource. When Gradle schedules tasks for execution it will ensure that the declared number
of leases is never exceeded by concurrently executing tasks. A shared resource with a single lease (the default) acts as an
exclusive resource, effectively limiting concurrency of any tasks that use that resource such that only a single one can be
executed at any given time.Named.Namer
Modifier and Type | Method | Description |
---|---|---|
int |
getLeases() |
Returns the maximum number of leases available to this resource.
|
void |
setLeases(int leases) |
Sets the maximum number of leases available to this resource.
|
void setLeases(int leases)
Sets the maximum number of leases available to this resource.
leases
- Number of leases.int getLeases()
Returns the maximum number of leases available to this resource.
A value of 1
indicates this is an exclusive resource and only a single task which requires this resource
can execute at any given time. This is the default value.