use of com.uber.cadence.TimeoutType in project cadence-client by uber-java.
the class ActivityDecisionContext method handleActivityTaskTimedOut.
void handleActivityTaskTimedOut(HistoryEvent event) {
ActivityTaskTimedOutEventAttributes attributes = event.getActivityTaskTimedOutEventAttributes();
String activityId = decisions.getActivityId(attributes);
if (decisions.handleActivityTaskClosed(activityId)) {
OpenRequestInfo<byte[], ActivityType> scheduled = scheduledActivities.remove(activityId);
if (scheduled != null) {
TimeoutType timeoutType = attributes.getTimeoutType();
byte[] details = attributes.getDetails();
ActivityTaskTimeoutException failure = new ActivityTaskTimeoutException(event.getEventId(), scheduled.getUserContext(), activityId, timeoutType, details);
BiConsumer<byte[], Exception> completionHandle = scheduled.getCompletionCallback();
completionHandle.accept(null, failure);
}
}
}
Aggregations