-
Notifications
You must be signed in to change notification settings - Fork 246
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
EDU-3715: Python update-with-start docs #3250
Merged
+74
−18
Merged
Changes from 9 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
13e29e9
encyclopedia tweaks
dandavison dd75c50
Go/Java tweaks
dandavison 9a7f106
Python & TS Update-With-Start docs
dandavison 978da25
Python and Typescript update-with-start docs
dandavison dacb4a5
Add missing word
dandavison 4432554
Document availability in PHP
dandavison e638a4d
Emphasize the execute version
dandavison c620487
Change predicted TS version
dandavison 7e2e6cf
Tweak language
dandavison aa3afb4
Applt fixed server tag 1.26.2
dandavison ba7421c
Applt fixed server tag 1.26.2
dandavison f188a82
Merge branch 'main' into python-ts-uws
brianmacdonald-temporal 7d5ed69
revert TS
dandavison e8b07b5
Merge branch 'main' into python-ts-uws
brianmacdonald-temporal 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 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 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 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 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 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 |
---|---|---|
|
@@ -187,32 +187,35 @@ Minimum Temporal Server version [Temporal Server version 1.26](https://github.co | |
|
||
- Available in [Go SDK](https://pkg.go.dev/go.temporal.io/[email protected]/client#Client.UpdateWithStartWorkflow) since [v1.31.0](https://github.com/temporalio/sdk-go/releases/tag/v1.31.0) | ||
- Available in [Java SDK](https://www.javadoc.io/doc/io.temporal/temporal-sdk/1.27.0/io/temporal/client/WorkflowStub.html#startUpdateWithStart(io.temporal.client.UpdateOptions,java.lang.Object%5B%5D,java.lang.Object%5B%5D)) since [v1.27.0](https://github.com/temporalio/sdk-java/releases/tag/v1.27.0) | ||
- Available in [Python SDK](/develop/python/message-passing#send-update-from-client) since [v1.9.0](https://github.com/temporalio/sdk-python/releases/tag/1.9.0) | ||
- Available in [TypeScript SDK](https://typescript.temporal.io/api/interfaces/client.WorkflowHandle#executeupdate) since [v1.11.6](https://github.com/temporalio/sdk-typescript/releases/tag/v1.11.6) | ||
- Available in [PHP SDK](https://php.temporal.io/classes/Temporal-Client-WorkflowClient.html#method_updateWithStart) since [v2.11.4](https://github.com/temporalio/sdk-php/releases/tag/v2.11.4) | ||
|
||
|
||
::: | ||
|
||
Update-With-Start sends an Update that checks whether an already-running Workflow with that ID exists. | ||
If it does, the Update is processed. | ||
If not, it starts a new Workflow Execution with the supplied ID. | ||
When starting a new Workflow, it immediately processes the Update. | ||
If it does, the Update is processed normally. | ||
If not, it starts a new Workflow Execution with the supplied ID, and immediately processes the Update. | ||
|
||
Update-With-Start is great for latency-sensitive use cases: | ||
|
||
- **Lazy Initialization** - | ||
Instead of making separate Start Workflow and Update Workflow calls, Update-With-Start allows you to send them together in a single roundtrip. | ||
For example, a shopping cart can be modelled using Update-With-Start. | ||
Updates let you add and remove items from the cart. | ||
For example, a shopping cart can be modeled using Update-With-Start. | ||
Updates let you add and remove items from the cart. | ||
Update-With-Start lets the customer start shopping, whether the cart already exists or they've just started shopping. | ||
It ensures the cart, modeled by a Workflow Execution, is created before applying any Update that changes the state of items within the cart. | ||
It ensures the cart, modeled by a Workflow Execution, exists before applying any Update that changes the state of items within the cart. | ||
- **Early Return** - | ||
Using Update-With-Start can begin a new Workflow Execution and synchronously receiving a response while the Workflow Execution continues to run to completion. | ||
Using Update-With-Start you can begin a new Workflow Execution and synchronously receive a response, while the Workflow Execution continues to run to completion. | ||
For example, you might model a payment process using Update-With-Start. | ||
Whether the payment completes or rolls back, you can send the payment validation results back to the client synchronously, while attempting the transaction asynchronously. | ||
This allows you to send the payment validation results back to the client synchronously, while the transaction Workflow continues in the background. | ||
|
||
:::caution | ||
|
||
Unlike Signal-with-Start - Update-With-Start is *not* atomic. | ||
If the Update can't be delivered, for example, say that there's no running Worker available, a new Workflow Execution will still start. | ||
The SDKs will retry the Update-With-Start request but there is no guarantee that it will succeed. | ||
If the Update can't be delivered, for example, because there's no running Worker available, a new Workflow Execution will still start. | ||
The SDKs will retry the Update-With-Start request, but there is no guarantee that the Update will succeed. | ||
|
||
::: | ||
|
||
|
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.
I had fixed this yesterday; the tag is wrong: d54486d
(same for the other link in TS)
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.
Oh, it seems I'm still using the wrong one in Java and Go.
Could you update that here while you're at it?
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.
Yep, done