Interface BuildRuleStrategy.StrategyBuildResult
-
- All Known Subinterfaces:
RemoteExecutionStrategy.RemoteExecutionStrategyBuildResult
- Enclosing interface:
- BuildRuleStrategy
public static interface BuildRuleStrategy.StrategyBuildResult
A simple interface for build results exposing an explicit cancellation.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
cancel(Throwable cause)
Indicates that the caller is no longer interested in the result and the strategy is free to cancel pending work.boolean
cancelIfNotComplete(Throwable reason)
Tries to cancel the execution if work has not yet past the point of no return.com.google.common.util.concurrent.ListenableFuture<Optional<BuildResult>>
getBuildResult()
A ListenableFuture for the build result.static BuildRuleStrategy.StrategyBuildResult
nonCancellable(com.google.common.util.concurrent.ListenableFuture<Optional<BuildResult>> result)
A simple helper to make a StrategyBuildResult that can't be cancelled.
-
-
-
Method Detail
-
cancel
void cancel(Throwable cause)
Indicates that the caller is no longer interested in the result and the strategy is free to cancel pending work.
-
cancelIfNotComplete
boolean cancelIfNotComplete(Throwable reason)
Tries to cancel the execution if work has not yet past the point of no return.- Returns:
- Whether cancellation was successful. If successful, the strategy might continue doing more work, but it must not make changes to any rule outputs. If cancellation is unsuccessful, the strategy should continue execution of the rule.
-
getBuildResult
com.google.common.util.concurrent.ListenableFuture<Optional<BuildResult>> getBuildResult()
A ListenableFuture for the build result.
-
nonCancellable
static BuildRuleStrategy.StrategyBuildResult nonCancellable(com.google.common.util.concurrent.ListenableFuture<Optional<BuildResult>> result)
A simple helper to make a StrategyBuildResult that can't be cancelled.
-
-