-
Notifications
You must be signed in to change notification settings - Fork 9
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
fix: async updates handler #475
Merged
Merged
Conversation
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
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
rustatian
added
B-regression
Bug: regression bugs
C-enhancement
Category: enhancement. Meaning improvements of current module, transport, etc..
labels
Feb 21, 2024
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
wolfy-j
approved these changes
Feb 29, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
B-regression
Bug: regression bugs
C-enhancement
Category: enhancement. Meaning improvements of current module, transport, etc..
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.
Reason for This PR
Activities
,SideEffects
, etc. inside the update handler.Description of Changes
UpdateValidated
andUpdateCompleted
.updates
handler.Tests:
Update.greet
workflow -> empty list on exit.Update.greet
workflow withaddNameWithoutValidation
method. Args:John Doe 42
->
should returnHello, John Doe 42!
.Update.greet
workflow withaddName
method. Args:John Doe
->
should returnHello, John Doe!
.Update.greet
workflow withaddName
method. Args:123
->
should failure with the message:Name must not contain digits
.Update.greet
workflow withthrowException
method. Args:John Doe
-> should failure with the following message:Test exception with John Doe
.Update.greet
workflow withrandomizeName
method. Args:1
(int) -> should execute a SideEffect and return a slice with the random string.3
(int)->
should execute a SideEffect and return 3 random strings in a slice.Update.greet
workflow withaddNameViaActivity
method. Args:John Doe
->
should execute an Activity and return lowercased name:Hello, john doe!
.AwaitsUpdate.greet
; updateawaitWithTimeout
with args"key"
,1
,"fallback"
-> the Update should sleep for 1 second and return"fallback"
; workflow should return{"key": "fallback"}
(associative array ->map[string]any
) (sendexit
signal to complete Workflow)AwaitsUpdate.greet
; start async updateawait
with arg"key"
-> will wait for resolving; querygetValue
with arg"key"
should returnnull
; updateresolveValue
with args"key"
,"resolved"
-> should resolve await in the previousawait
update and return"resolved"
; querygetValue
with arg"key"
should return"resolved"
; workflow should return{"key": "resolved"}
(sendexit
signal to complete Workflow)await
Updates and then 5resolve
Updates (use unique keys in args)->
should open and complete 5 parallel updates.AwaitsUpdate.greet
; for $i from 1 to 3, start async updateawaitWithTimeout
with args"key$i"
,5
,"fallback$i"
; for $i from 1 to 3, start async updateresolveValue
with args"key$i"
,"resolved$i"
-> awaits will be resolved before timeout; workflow should return{"key1": "fallback1", "key2": "fallback2", "key3": "fallback3",}
(sendexit
signal to complete Workflow)Note
Tests from 9 should be executed with
WaitPolicy=StageAccepted
, and Temporal server optionfrontend.enableUpdateWorkflowExecutionAsyncAccepted=true
Warning
All the tests require Temporal option
frontend.enableUpdateWorkflowExecution=true
Warning
Need to discard changes in
composer.json
before merging intomaster
branchLicense Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the MIT license.
PR Checklist
[Author TODO: Meet these criteria.]
[Reviewer TODO: Verify that these criteria are met. Request changes if not]
git commit -s
).CHANGELOG.md
.