Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use WorkflowUpdateHandle #532

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions features/update/async_accepted/feature.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package update.async_accepted;

import io.temporal.activity.ActivityInterface;
import io.temporal.client.UpdateHandle;
import io.temporal.client.UpdateOptions;
import io.temporal.client.WorkflowUpdateException;
import io.temporal.client.WorkflowUpdateHandle;
import io.temporal.client.WorkflowUpdateStage;
import io.temporal.client.WorkflowUpdateTimeoutOrCancelledException;
import io.temporal.failure.ApplicationFailure;
Expand Down Expand Up @@ -71,7 +71,7 @@ public Run execute(Runner runner) throws Exception {

// Issue an async update that should succeed after SLEEP_TIMEOUT
var updateId = UUID.randomUUID().toString();
UpdateHandle<Integer> handle =
WorkflowUpdateHandle<Integer> handle =
untypedStub.startUpdate(
UpdateOptions.newBuilder(Integer.class)
.setUpdateName("update")
Expand All @@ -82,13 +82,13 @@ public Run execute(Runner runner) throws Exception {
true);

// Create a separate handle to the same update
UpdateHandle<Integer> otherHandle = untypedStub.getUpdateHandle(updateId, Integer.class);
WorkflowUpdateHandle<Integer> otherHandle = untypedStub.getUpdateHandle(updateId, Integer.class);
// should block on in-flight update
Assertions.assertEquals(UPDATE_RESULT, otherHandle.getResultAsync().get());
Assertions.assertEquals(UPDATE_RESULT, handle.getResultAsync().get());
// issue an async update that should throw
updateId = UUID.randomUUID().toString();
UpdateHandle<Integer> errorHandle =
WorkflowUpdateHandle<Integer> errorHandle =
untypedStub.startUpdate(
UpdateOptions.newBuilder(Integer.class)
.setUpdateName("update")
Expand All @@ -111,7 +111,7 @@ public Run execute(Runner runner) throws Exception {
}
// issue an update that will succeed after `requestedSleep`
updateId = UUID.randomUUID().toString();
UpdateHandle<Integer> timeoutHandle =
WorkflowUpdateHandle<Integer> timeoutHandle =
untypedStub.startUpdate(
UpdateOptions.newBuilder(Integer.class)
.setUpdateName("update")
Expand Down
4 changes: 2 additions & 2 deletions features/update/client_interceptor/feature.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package update.client_interceptor;

import io.temporal.client.UpdateHandle;
import io.temporal.client.WorkflowClientOptions;
import io.temporal.client.WorkflowUpdateHandle;
import io.temporal.common.interceptors.WorkflowClientCallsInterceptor;
import io.temporal.common.interceptors.WorkflowClientCallsInterceptorBase;
import io.temporal.common.interceptors.WorkflowClientInterceptorBase;
Expand Down Expand Up @@ -54,7 +54,7 @@ public WorkflowClientCallsInterceptor workflowClientCallsInterceptor(
WorkflowClientCallsInterceptor next) {
return new WorkflowClientCallsInterceptorBase(next) {
@Override
public <R> UpdateHandle<R> startUpdate(StartUpdateInput<R> input) {
public <R> WorkflowUpdateHandle<R> startUpdate(StartUpdateInput<R> input) {
if (input.getUpdateName() == "update") {
input.getArguments()[0] = ((int) input.getArguments()[0]) + 1;
}
Expand Down
6 changes: 3 additions & 3 deletions features/update/deduplication/feature.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package update.deduplication;

import io.temporal.client.UpdateHandle;
import io.temporal.client.UpdateOptions;
import io.temporal.client.WorkflowUpdateHandle;
import io.temporal.client.WorkflowUpdateStage;
import io.temporal.sdkfeatures.Feature;
import io.temporal.sdkfeatures.Run;
Expand Down Expand Up @@ -76,8 +76,8 @@ public Run execute(Runner runner) throws Exception {
.setFirstExecutionRunId(run.execution.getRunId())
.build();

UpdateHandle<Integer> handle1 = untypedStub.startUpdate(updateOptions);
UpdateHandle<Integer> handle2 = untypedStub.startUpdate(updateOptions);
WorkflowUpdateHandle<Integer> handle1 = untypedStub.startUpdate(updateOptions);
WorkflowUpdateHandle<Integer> handle2 = untypedStub.startUpdate(updateOptions);

Assertions.assertEquals(1, handle1.getResultAsync().get());
Assertions.assertEquals(1, handle2.getResultAsync().get());
Expand Down
Loading