-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchoreography.007
More file actions
22 lines (21 loc) · 734 Bytes
/
Copy pathchoreography.007
File metadata and controls
22 lines (21 loc) · 734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-- SPDX-License-Identifier: MPL-2.0
-- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath)
--
-- Example: Choreographic programming.
-- Demonstrates multi-party choreographies with branches, loops, and decisions.
-- Multi-party choreography
choreography auction(auctioneer: Agent<Auctioneer>, bidder: Agent<Bidder>) {
auctioneer -> bidder : announce
loop bidding {
bidder -> auctioneer : bid
branch traced "bid_evaluation" {
| accept given { bid_amount: 100 } -> {
auctioneer -> bidder : accept_bid
}
| reject given { bid_amount: 0 } -> {
auctioneer -> bidder : reject_bid
}
}
}
auctioneer decides winner ?
}