Skip to content

Commit

Permalink
add get workflow history async grpc API (#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkolodezny authored Jul 27, 2022
1 parent d3a8515 commit 9fd6ad9
Showing 1 changed file with 22 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1074,24 +1074,28 @@ public void GetWorkflowExecutionHistoryWithTimeout(
AsyncMethodCallback resultHandler,
Long timeoutInMillis)
throws TException {
// TODO test
ListenableFuture<com.uber.cadence.api.v1.GetWorkflowExecutionHistoryResponse> resultFuture =
grpcServiceStubs
.workflowFutureStub()
.withDeadline(Deadline.after(timeoutInMillis, TimeUnit.MILLISECONDS))
.getWorkflowExecutionHistory(
RequestMapper.getWorkflowExecutionHistoryRequest(getRequest));
resultFuture.addListener(
() -> {
try {
com.uber.cadence.api.v1.GetWorkflowExecutionHistoryResponse response =
resultFuture.get();
resultHandler.onComplete(ResponseMapper.getWorkflowExecutionHistoryResponse(response));
} catch (Exception e) {
resultHandler.onError(e);
}
},
ForkJoinPool.commonPool());
try {
ListenableFuture<com.uber.cadence.api.v1.GetWorkflowExecutionHistoryResponse> resultFuture =
grpcServiceStubs
.workflowFutureStub()
.withDeadline(Deadline.after(timeoutInMillis, TimeUnit.MILLISECONDS))
.getWorkflowExecutionHistory(
RequestMapper.getWorkflowExecutionHistoryRequest(getRequest));
resultFuture.addListener(
() -> {
try {
com.uber.cadence.api.v1.GetWorkflowExecutionHistoryResponse response =
resultFuture.get();
resultHandler
.onComplete(ResponseMapper.getWorkflowExecutionHistoryResponse(response));
} catch (Exception e) {
resultHandler.onError(e);
}
},
ForkJoinPool.commonPool());
} catch (StatusRuntimeException e) {
throw ErrorMapper.Error(e);
}
}

@Override
Expand Down

0 comments on commit 9fd6ad9

Please sign in to comment.