-
Notifications
You must be signed in to change notification settings - Fork 247
💥 Use ActivitySerializationContext when starting and getting result of Standalone Activity #3063
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
Open
maciejdudko
wants to merge
7
commits into
temporalio:main
Choose a base branch
from
maciejdudko:saa-serialization-context
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+572
−15
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
afc5c28
Use ActivitySerializationContext when starting and getting result of …
maciejdudko edc2379
Fixed NPE
maciejdudko feab6c5
Merge branch 'main' into saa-serialization-context
maciejdudko d12cd40
Added tests
maciejdudko 6a94f61
Merge branch 'main' into saa-serialization-context
maciejdudko d059635
Fixed getResultAsync, added test for local activity
maciejdudko ef9e2b7
Merge branch 'main' into saa-serialization-context
maciejdudko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,32 +11,34 @@ public class ActivitySerializationContext implements HasWorkflowSerializationCon | |
| private final @Nonnull String namespace; | ||
| private final @Nullable String workflowId; | ||
| private final @Nullable String workflowType; | ||
| private final @Nonnull String activityType; | ||
| private final @Nonnull String activityTaskQueue; | ||
| private final @Nullable String activityType; | ||
| private final @Nullable String activityTaskQueue; | ||
| private final boolean local; | ||
|
|
||
| /** | ||
| * @param namespace the activity's namespace; must not be {@code null} | ||
| * @param workflowId the workflow ID that scheduled the activity, or {@code null} for standalone | ||
| * activities (stored as an empty string) | ||
| * activities | ||
| * @param workflowType the workflow type that scheduled the activity, or {@code null} for | ||
| * standalone activities (stored as an empty string) | ||
| * @param activityType the activity type name; must not be {@code null} | ||
| * @param activityTaskQueue the task queue for this activity; must not be {@code null} | ||
| * standalone activities | ||
| * @param activityType the activity type name, or {@code null} if unknown. Activity type is | ||
| * unknown when getting a Standalone Activity result. | ||
| * @param activityTaskQueue the task queue for this activity, or {@code null} if unknown. Task | ||
| * queue is unknown when getting a Standalone Activity result. | ||
| * @param local {@code true} if this is a local activity | ||
| */ | ||
| public ActivitySerializationContext( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting we don't have activity ID here 🤔 |
||
| @Nonnull String namespace, | ||
| @Nullable String workflowId, | ||
| @Nullable String workflowType, | ||
| @Nonnull String activityType, | ||
| @Nonnull String activityTaskQueue, | ||
| @Nullable String activityType, | ||
| @Nullable String activityTaskQueue, | ||
| boolean local) { | ||
| this.namespace = Objects.requireNonNull(namespace); | ||
| this.workflowId = workflowId; | ||
| this.workflowType = workflowType; | ||
| this.activityType = Objects.requireNonNull(activityType); | ||
| this.activityTaskQueue = Objects.requireNonNull(activityTaskQueue); | ||
| this.activityType = activityType; | ||
| this.activityTaskQueue = activityTaskQueue; | ||
| this.local = local; | ||
| } | ||
|
|
||
|
|
@@ -67,12 +69,12 @@ public String getWorkflowType() { | |
| return workflowType; | ||
| } | ||
|
|
||
| @Nonnull | ||
| @Nullable | ||
| public String getActivityType() { | ||
| return activityType; | ||
| } | ||
|
|
||
| @Nonnull | ||
| @Nullable | ||
| public String getActivityTaskQueue() { | ||
| return activityTaskQueue; | ||
| } | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, technically here we can know the task queue if the handle was created by a start or execute call and we would often know the type if the user created the handle with the typed API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Standalone Activities can have task queue changed after start. Really we should deprecate task queue in serialization context altogether.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is some value in task queue since users can have different data converters on different task queues so I wouldn't want to deprecate it IMO, but I can understand not wanting to assume it.