|
|
|
|
|
by pirsquare
28 days ago
|
|
I feel it's way too hand wavy on consistency and correctness. My opinion as someone who've implemented marketing workflows that breaks all the time (and tons of painful lessons). Strong correctness guarantee is something that should not be undermine. Even more important than availability. The examples on the website is simple but heavily undermines the importance of correctness. Anyone who implement similar pseudo-code directly will eventually suffer from data correctness issue in crashes. @DBOS.workflow()
def checkout_workflow(items: Items):
order = create_order()
reserve_inventory(order, items)
payment_status = process_payment(order, items)
if payment_status == 'paid':
fulfill_order(order)
else:
undo_reserve_inventory(order, items)
cancel_order(order)
|
|