use of com.google.devtools.build.lib.remote.ExecuteServiceGrpc.ExecuteServiceBlockingStub in project bazel by bazelbuild.
the class RemoteWorkExecutor method executeRemotely.
public ExecuteReply executeRemotely(ExecuteRequest request) {
ExecuteServiceBlockingStub stub = ExecuteServiceGrpc.newBlockingStub(channel).withDeadlineAfter(options.grpcTimeoutSeconds + request.getTimeoutMillis() / 1000, TimeUnit.SECONDS);
Iterator<ExecuteReply> replies = stub.execute(request);
ExecuteReply reply = null;
while (replies.hasNext()) {
reply = replies.next();
// We can handle the action execution progress here.
}
if (reply == null) {
return ExecuteReply.newBuilder().setStatus(ExecutionStatus.newBuilder().setExecuted(false).setSucceeded(false).setError(ExecutionStatus.ErrorCode.UNKNOWN_ERROR).setErrorDetail("Remote server terminated the connection")).build();
}
return reply;
}
Aggregations