public class HybridLocalStrategy extends Object implements BuildRuleStrategy
It has a configurable limit for the number of active jobs to allow locally, and for the number to allow to the delegate. It prefers to send them locally if the limit there hasn't been reached. If both are at the limit, the jobs will be queued until space becomes available.
BuildRuleStrategy.StrategyBuildResult
Constructor and Description |
---|
HybridLocalStrategy(int numLocalJobs,
int numLocalDelegateJobs,
int numDelegateJobs,
BuildRuleStrategy delegate,
WorkerRequirementsProvider workerRequirementsProvider,
Optional<com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerSize> maxWorkerSizeToStealFrom,
String auxiliaryBuildTag,
BuckEventBus eventBus) |
Modifier and Type | Method and Description |
---|---|
BuildRuleStrategy.StrategyBuildResult |
build(BuildRule rule,
BuildStrategyContext strategyContext)
Builds the rule.
|
boolean |
canBuild(BuildRule instance)
A rule will be built by the custom strategy only if canBuild() returns true.
|
void |
close() |
public HybridLocalStrategy(int numLocalJobs, int numLocalDelegateJobs, int numDelegateJobs, BuildRuleStrategy delegate, WorkerRequirementsProvider workerRequirementsProvider, Optional<com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerSize> maxWorkerSizeToStealFrom, String auxiliaryBuildTag, BuckEventBus eventBus)
public BuildRuleStrategy.StrategyBuildResult build(BuildRule rule, BuildStrategyContext strategyContext)
BuildRuleStrategy
build
in interface BuildRuleStrategy
public boolean canBuild(BuildRule instance)
BuildRuleStrategy
canBuild
in interface BuildRuleStrategy
public void close() throws IOException
close
in interface BuildRuleStrategy
close
in interface Closeable
close
in interface AutoCloseable
IOException