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

Move workflow update polling inside of interceptor #2159

Merged

Conversation

Sushisource
Copy link
Member

What was changed

Moved update polling to be inside of the interceptor a-la other SDKs

Why?

Consistent, allows interceptor to change things post-polling

Checklist

  1. Closes Java SDK StartUpdate waits outside of intercepted call #2094

  2. How was this tested:
    Added an integ test using the interceptor

  3. Any docs updates needed?

@Sushisource Sushisource requested a review from a team as a code owner July 30, 2024 01:17
Comment on lines +116 to +117
public <R> UpdateHandle<R> startUpdate(StartUpdateInput<R> input) {
super.startUpdate(input);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side note: Why don't we have something like InputType.fromExisting(input) and then some way to relatively easily modify the input? It's a bit annoying to have to re-pass every field through to a new constructor if you want to modify inputs.

I get why they're not directly mutable, but, might be nice to have a convenient way to do that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modify inputs is not really an encouraged pattern. Not that some users don't but I it is a advanced path to take.

@@ -119,7 +120,7 @@ public <R> QueryOutput<R> query(QueryInput<R> input) {
}

@Override
public <R> StartUpdateOutput<R> startUpdate(StartUpdateInput<R> input) {
public <R> UpdateHandle<R> startUpdate(StartUpdateInput<R> input) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm I wonder if we would ever need to return more then UpdateHandle here? I think other SDKs just return UpdateHandle so if we do will have to address in all SDKs

Copy link
Contributor

@Quinn-With-Two-Ns Quinn-With-Two-Ns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@Sushisource Sushisource force-pushed the move-update-poll-inside-interceptor branch from 7405311 to 1cb3b82 Compare July 30, 2024 15:58
@Sushisource Sushisource enabled auto-merge (squash) July 30, 2024 16:16
@Sushisource Sushisource merged commit bbf2de7 into temporalio:master Jul 30, 2024
8 checks passed
@Sushisource Sushisource deleted the move-update-poll-inside-interceptor branch July 30, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Java SDK StartUpdate waits outside of intercepted call
2 participants