-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
20 lines (19 loc) · 715 Bytes
/
Program.cs
File metadata and controls
20 lines (19 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using Restate.Sdk.Hosting;
using Saga;
// Saga pattern: compensating transactions for distributed bookings.
// If any step fails, previously completed bookings are rolled back in reverse order.
//
// Test:
// restate invocations invoke TripBookingService Book --body '{
// "tripId": "trip-1",
// "userId": "alice",
// "flight": { "from": "SFO", "to": "JFK", "date": "2026-03-15" },
// "hotel": { "city": "New York", "checkIn": "2026-03-15", "checkOut": "2026-03-18" },
// "carRental": { "city": "New York", "pickUp": "2026-03-15", "dropOff": "2026-03-18" }
// }'
await RestateHost
.CreateBuilder()
.WithPort(9086)
.AddService<TripBookingService>()
.Build()
.RunAsync();