-
Notifications
You must be signed in to change notification settings - Fork 224
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-3229: Workflow Initializers Encyclopedia entry #3114
base: main
Are you sure you want to change the base?
Conversation
84f00ed
to
3ac5a8b
Compare
@drewhoskins-temporal This is a wonderful expansion that reduces developer confusion and helps make sure that handlers aren't run before Workflow state is set. Based on the Friday meeting, Docs/EDU should be providing guidance rather than re-writes. Happy to set up a Zoom call. A few points of feedback
Thank you for filing the ticket and getting this update underway. It's appreciated. Also, always feel free to reach out to me to help me improve my feedback. As we're growing our cooperation I want to find ways to best support these items. |
0755df6
to
b2c31bf
Compare
- Finishing handlers before the Workflow completes. | ||
- Ensuring your messages are processed exactly once. | ||
- Injecting work into the main Workflow | ||
- Finishing handlers before the Workflow completes |
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.
Only because of previous tickets do I know that this really means something along the lines of blocking the Workflow's completion until all handlers have finished processing, otherwise I don't know if it really would be meaningful to me at first read.
Suggest minor rewording to make it clearer
- Ensuring your messages are processed exactly once. | ||
- Injecting work into the main Workflow | ||
- Finishing handlers before the Workflow completes | ||
- Ensuring your messages are processed exactly once |
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.
This is very cool. Whose responsibility is this? Is it worth a sidebar ("admonition"/callout) with a link to a source of truth to explain? Does this happen often?
1ade408
to
372be3b
Compare
372be3b
to
781087f
Compare
@@ -220,22 +220,40 @@ Every time the Workflow wakes up--generally, it wakes up when it needs to--it wi | |||
|
|||
This execution is on a single thread–while this means you don’t have to worry about parallelism, you do need to worry about concurrency if you have written Signal and Update handlers that can block. These can run interleaved with the main Workflow and with one another, resulting in potential race conditions. These methods should be made reentrant. | |||
|
|||
#### Initializing the Workflow first {#workflow-initializers} | |||
|
|||
Initialize your Workflow's state before handling messages. This prevents your Workflow reading uninitialized instance variables. |
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 you mean that it prevents your Handlers from reading uninitialized instance variables.
Initialize your Workflow's state before handling messages. This prevents your Workflow reading uninitialized instance variables. | |
Initialize your Workflow's state before handling messages. | |
This prevents your Handlers from reading uninitialized instance variables if they arrive before the Workflow state is entire set up. |
What does this PR do?
Overview documentation the new Workflow Initializer feature.
Notes to reviewers
Test plan:
Click on links.