-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
37 additions
and
140 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
16 | ||
22 |
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 |
---|---|---|
@@ -1,17 +1,23 @@ | ||
# Early Return | ||
|
||
This sample demonstrates how to use the "Early Return" pattern via update-with-start. | ||
|
||
The "Early Return" pattern involves using update-with-start to start a Workflow and send an Update in the | ||
first Workflow Task. The Update handler waits until the Workflow reaches a certain state of interest, and then | ||
returns some data to the caller. The Workflow continues to execute in the background, and the caller has | ||
possession of a `WorkflowHandle` to follow up on the Workflow progress. | ||
The "Early Return" pattern involves using update-with-start to start a Workflow and send an Update | ||
in the first Workflow Task. The Update handler waits until the Workflow reaches a certain state of | ||
interest, and then returns some data to the caller. The Workflow continues to execute in the background, | ||
and the caller has possession of a `WorkflowHandle` to follow up on the Workflow progress. | ||
|
||
In this example, the Workflow represents a financial transaction, and we use Early Return to wait until the | ||
transaction has been confirmed, leaving the Workflow to complete the remaining stages of the transaction in | ||
the background. | ||
In this example, the Workflow represents a financial transaction, and we use Early Return to wait | ||
until the transaction has been confirmed, leaving the Workflow to complete the remaining stages of | ||
the transaction in the background. | ||
|
||
### Running this sample | ||
|
||
1. `pnpm install` to install dependencies. | ||
1. Run a Temporal Server via `temporal server start-dev --dynamic-config-value frontend.enableExecuteMultiOperation=true`, using at least version `v1.1.2` of the `temporal` CLI. | ||
1. `pnpm run start.watch` to start the Worker. | ||
1 `pnpm run workflow tx-abc123` to run a transaction workflow, obtaining an "early return" via Update-With-Start. | ||
1. Start a Temporal Server via: | ||
``` | ||
temporal server start-dev --dynamic-config-value frontend.enableExecuteMultiOperation=true | ||
``` | ||
Update-with-Start requires version `v1.1.2` or later of the `temporal` CLI. | ||
2. `npm install` to install dependencies (or `pnpm` or `yarn`). | ||
3. `npm run start.watch` to start the Worker. | ||
4 `npm run workflow tx-abc123` to run a transaction workflow, obtaining an "early return" via Update-With-Start. |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.