Search in sources :

Example 1 with WaitExecutionRequest

use of build.bazel.remote.execution.v2.WaitExecutionRequest in project bazel-buildfarm by bazelbuild.

the class StubInstance method watchOperation.

@Override
public ListenableFuture<Void> watchOperation(String operationName, Watcher watcher) {
    WaitExecutionRequest request = WaitExecutionRequest.newBuilder().setName(operationName).build();
    SettableFuture<Void> result = SettableFuture.create();
    newExStub().waitExecution(request, new StreamObserver<Operation>() {

        @Override
        public void onNext(Operation operation) {
            watcher.observe(operation);
        }

        @Override
        public void onError(Throwable t) {
            result.setException(t);
        }

        @Override
        public void onCompleted() {
            result.set(null);
        }
    });
    return result;
}
Also used : WaitExecutionRequest(build.bazel.remote.execution.v2.WaitExecutionRequest) Operation(com.google.longrunning.Operation)

Aggregations

WaitExecutionRequest (build.bazel.remote.execution.v2.WaitExecutionRequest)1 Operation (com.google.longrunning.Operation)1