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

Update with start #381

Merged
merged 3 commits into from
Dec 17, 2024
Merged

Update with start #381

merged 3 commits into from
Dec 17, 2024

Conversation

cretz
Copy link
Member

@cretz cretz commented Dec 16, 2024

What was changed

Added StartUpdateWithStartWorkflowAsync and ExecuteUpdateWithStartWorkflowAsync client calls and all that entails. Marked as experimental.

Checklist

  1. Closes UpdateWithStart SDK API #346

@cretz cretz requested a review from a team December 16, 2024 20:46
}

using (var activity = ClientSource.StartActivity(
$"UpdateWithStartWorkflow:{input.Options.StartWorkflowOperation.Workflow}",
Copy link
Member Author

Choose a reason for hiding this comment

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

@dandavison - note this differs from Go. In Go, this is UpdateWithStartWorkflow:<update-name> whereas here it is UpdateWithStartWorkflow:<workflow-name>. This latter behavior matches signal with start in both SDKs (i.e. it's SignalWithStartWorkflow:<workflow-name> not SignalWithStartWorkflow:<signal-name>), and of course inbound update does get its own span worker side. Not sure we even properly set tracing in any other update-with-start SDK.

src/Temporalio/Client/TemporalClient.Workflow.cs Outdated Show resolved Hide resolved
src/Temporalio/Client/TemporalClient.Workflow.cs Outdated Show resolved Hide resolved
Copy link
Contributor

@dandavison dandavison left a comment

Choose a reason for hiding this comment

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

LGTM, I didn't see anything missing or out of line with the plan.

src/Temporalio/Client/TemporalClient.Workflow.cs Outdated Show resolved Hide resolved
@@ -92,6 +92,84 @@ WorkflowHandle<TWorkflow> GetWorkflowHandle<TWorkflow>(
WorkflowHandle<TWorkflow, TResult> GetWorkflowHandle<TWorkflow, TResult>(
string id, string? runId = null, string? firstExecutionRunId = null);

/// <summary>
/// Start an update via a call to a WorkflowUpdate attributed method, possibly starting the
Copy link
Contributor

Choose a reason for hiding this comment

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

"via a call to a WorkflowUpdate attributed method" means "this will end up causing an update handler method to be executed in a workflow"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not exactly. What "via a call" means is that this is a lambda expression that makes a call to a method with the WorkflowUpdate attribute. So it looks like myClient.StartUpdateWithStartWorkflow((MyWorkflow wf) => wf.MyUpdateMethodWithAttribute(myArg), ....

@cretz cretz merged commit 855047e into temporalio:main Dec 17, 2024
8 checks passed
@cretz cretz deleted the update-with-start branch December 17, 2024 14:16
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.

UpdateWithStart SDK API
2 participants