-
Notifications
You must be signed in to change notification settings - Fork 56
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: shopping cart #156
base: main
Are you sure you want to change the base?
Conversation
5ee2dbb
to
4f8940e
Compare
message_passing/update_with_start/lazy_initialization/README.md
Outdated
Show resolved
Hide resolved
|
||
@workflow.signal | ||
def checkout(self): | ||
self.order_submitted = True |
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.
Hrmm, I wonder if we should add a validator that disallows add_item
if this is true. While this workflow is safe and doesn't need it, it could be a good demo, and would help users if they ever had a step between the wait condition and the return.
from message_passing.update_with_start.lazy_initialization.activities import ( | ||
ShoppingCartItem, | ||
get_price, | ||
) |
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.
from message_passing.update_with_start.lazy_initialization.activities import ( | |
ShoppingCartItem, | |
get_price, | |
) | |
with workflow.unsafe.imports_passed_through(): | |
from message_passing.update_with_start.lazy_initialization.activities import ( | |
ShoppingCartItem, | |
get_price, | |
) |
Need to encourage passing through all activity references and externally defined models instead of reloading them every workflow (for the samples this technically works because the activity doesn't do anything externally meaningful)
Co-authored-by: Chad Retz <[email protected]>
Co-authored-by: Chad Retz <[email protected]>
@@ -0,0 +1,16 @@ | |||
# Update With Start: Lazy init |
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.
Can you add a little blurb as to what "lazy init" means here? Does lazy init here refer to how we're using update_with_start to initialize and start the workflow?
The Workflow represents a Shopping Cart in an e-commerce application, and
update-with-start is used to add items to the cart, receiving back the updated cart subtotal.
Cannot be merged until UwS is released