Skip to content

Commit cb28dcc

Browse files
committed
fix(examples): add sleep between AuditLogDemo emits to drain handlers
The async event handlers race with the main feature set. On macOS CI the UserCreated handler didn't get CPU time before the process moved on, causing a missing-line failure. Adding 100ms sleeps between emits gives each handler time to execute and log.
1 parent 13e7926 commit cb28dcc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Examples/AuditLogDemo/main.aro

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,21 @@
1818
Emit a <UserCreated: event> with {
1919
user: { id: "user-123", name: "Alice", email: "alice@example.com" }
2020
}.
21+
Sleep the <wait1> for 100 milliseconds.
2122

2223
(* Emit an OrderPlaced event - the plugin handler will respond *)
2324
Log "Emitting OrderPlaced event..." to the <console>.
2425
Emit an <OrderPlaced: event> with {
2526
order: { id: "order-456", total: 99.99, items: 3 }
2627
}.
28+
Sleep the <wait2> for 100 milliseconds.
2729

2830
(* Emit a PaymentReceived event - the plugin handler will respond *)
2931
Log "Emitting PaymentReceived event..." to the <console>.
3032
Emit a <PaymentReceived: event> with {
3133
payment: { id: "pay-789", amount: 99.99, method: "credit_card" }
3234
}.
35+
Sleep the <wait3> for 100 milliseconds.
3336

3437
Log "=== Demo Complete ===" to the <console>.
3538
Return an <OK: status> for the <startup>.

0 commit comments

Comments
 (0)