feat(visitors): message and concurrent payload visitors#2902
Draft
jmaeagle99 wants to merge 1 commit into
Draft
Conversation
25b02f3 to
67d651e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was changed
Adds an SDK-internal payload/message visitor for Temporal API proto messages (
io.temporal.internal.payload.visitorintemporal-sdk).PayloadVisitors.visit(message, options)— invokes a callback on everyPayloadreachable in any API message; the callback returns replacements, so payloads can be transformed in place.MessageVisitors.visit(message, options)— invokes a callback on each payload-bearing message (no per-payload visiting), for per-message-type logic.MessageVisitor) that threads a scoped value down the tree — e.g. tag payloads with the enclosing command's info.concurrency > 1requires a caller-suppliedExecutor.google.protobuf.Any, and cyclic messages (Failure).The traversal code is generated at build time from the proto descriptors (new
payloadVisitorGeneratorsource set + Gradle task; output underbuild/generated, not committed).Why?
Provides the shared traversal foundation the upcoming external storage feature needs (concurrently offload large payloads), and the planned payload-limits validator.
Checklist
Closes Enable concurrent payload visiting - Java #2881 Allow payload visitors to visit memo payloads in aggregate - Java #2884
How was this tested: Unit tests under
io.temporal.internal.payload.visitor(PayloadVisitorTest,MessageVisitorTest) covering traversal/mutation across every field shape,Any, cyclic messages, scoped context, concurrency, and error propagationAny docs updates needed? No, internal implementation.