Documentation
¶
Overview ¶
Package main demonstrates the Saga pattern with compensation.
This example shows: - Multiple activities with compensation functions - Automatic compensation on failure (LIFO order) - Transaction-like behavior without distributed transactions
The workflow simulates a trip booking: 1. Book flight 2. Reserve hotel 3. Rent car 4. Process payment (fails to trigger compensations)
Usage:
go run ./examples/saga/
Click to show internal directories.
Click to hide internal directories.