Skip to content

Commit 9fd6ad9

Browse files
authored
add get workflow history async grpc API (#702)
1 parent d3a8515 commit 9fd6ad9

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

src/main/java/com/uber/cadence/internal/compatibility/Thrift2ProtoAdapter.java

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,24 +1074,28 @@ public void GetWorkflowExecutionHistoryWithTimeout(
10741074
AsyncMethodCallback resultHandler,
10751075
Long timeoutInMillis)
10761076
throws TException {
1077-
// TODO test
1078-
ListenableFuture<com.uber.cadence.api.v1.GetWorkflowExecutionHistoryResponse> resultFuture =
1079-
grpcServiceStubs
1080-
.workflowFutureStub()
1081-
.withDeadline(Deadline.after(timeoutInMillis, TimeUnit.MILLISECONDS))
1082-
.getWorkflowExecutionHistory(
1083-
RequestMapper.getWorkflowExecutionHistoryRequest(getRequest));
1084-
resultFuture.addListener(
1085-
() -> {
1086-
try {
1087-
com.uber.cadence.api.v1.GetWorkflowExecutionHistoryResponse response =
1088-
resultFuture.get();
1089-
resultHandler.onComplete(ResponseMapper.getWorkflowExecutionHistoryResponse(response));
1090-
} catch (Exception e) {
1091-
resultHandler.onError(e);
1092-
}
1093-
},
1094-
ForkJoinPool.commonPool());
1077+
try {
1078+
ListenableFuture<com.uber.cadence.api.v1.GetWorkflowExecutionHistoryResponse> resultFuture =
1079+
grpcServiceStubs
1080+
.workflowFutureStub()
1081+
.withDeadline(Deadline.after(timeoutInMillis, TimeUnit.MILLISECONDS))
1082+
.getWorkflowExecutionHistory(
1083+
RequestMapper.getWorkflowExecutionHistoryRequest(getRequest));
1084+
resultFuture.addListener(
1085+
() -> {
1086+
try {
1087+
com.uber.cadence.api.v1.GetWorkflowExecutionHistoryResponse response =
1088+
resultFuture.get();
1089+
resultHandler
1090+
.onComplete(ResponseMapper.getWorkflowExecutionHistoryResponse(response));
1091+
} catch (Exception e) {
1092+
resultHandler.onError(e);
1093+
}
1094+
},
1095+
ForkJoinPool.commonPool());
1096+
} catch (StatusRuntimeException e) {
1097+
throw ErrorMapper.Error(e);
1098+
}
10951099
}
10961100

10971101
@Override

0 commit comments

Comments
 (0)