|
1 | 1 | package io.temporal.internal.sync; |
2 | 2 |
|
| 3 | +import static com.google.common.base.Preconditions.checkNotNull; |
| 4 | + |
3 | 5 | import io.temporal.common.context.ContextPropagator; |
| 6 | +import io.temporal.failure.CanceledFailure; |
| 7 | +import io.temporal.internal.common.NonIdempotentHandle; |
4 | 8 | import io.temporal.internal.worker.WorkflowExecutorCache; |
| 9 | +import io.temporal.workflow.CompletablePromise; |
| 10 | +import io.temporal.workflow.Promise; |
| 11 | +import io.temporal.workflow.Workflow; |
5 | 12 | import java.util.HashMap; |
6 | 13 | import java.util.List; |
7 | 14 | import java.util.Map; |
8 | 15 | import java.util.Optional; |
| 16 | +import java.util.concurrent.CompletableFuture; |
9 | 17 | import java.util.concurrent.Future; |
10 | 18 | import java.util.function.Supplier; |
11 | 19 | import javax.annotation.Nonnull; |
@@ -62,7 +70,7 @@ class RepeatableWorkflowThread implements WorkflowThread { |
62 | 70 | private int evaluationCount = 0; |
63 | 71 |
|
64 | 72 | /** Cached cancellation promise, following the pattern from CancellationScopeImpl. */ |
65 | | - private io.temporal.workflow.CompletablePromise<String> cancellationPromise; |
| 73 | + private CompletablePromise<String> cancellationPromise; |
66 | 74 |
|
67 | 75 | private final WorkflowThreadExecutor workflowThreadExecutor; |
68 | 76 | private final SyncWorkflowContext syncWorkflowContext; |
@@ -243,12 +251,12 @@ public String getCancellationReason() { |
243 | 251 | } |
244 | 252 |
|
245 | 253 | @Override |
246 | | - public io.temporal.workflow.Promise<String> getCancellationRequest() { |
| 254 | + public Promise<String> getCancellationRequest() { |
247 | 255 | if (currentEvaluationThread != null) { |
248 | 256 | return currentEvaluationThread.getCancellationRequest(); |
249 | 257 | } |
250 | 258 | if (cancellationPromise == null) { |
251 | | - cancellationPromise = io.temporal.workflow.Workflow.newPromise(); |
| 259 | + cancellationPromise = Workflow.newPromise(); |
252 | 260 | if (isCancelled()) { |
253 | 261 | cancellationPromise.complete(getEffectiveCancellationReason()); |
254 | 262 | } |
|
0 commit comments