Events Overview
This section covers how you work with events in application development — declaring payloads, naming conventions, dispatching from rules, versioning, and testing.
For the append-only ledger and replay, see Replay and Debugging — Ledger Events.
How events fit into Causet
Events are facts appended to the ledger. Intents emit them. Projections consume them.
Declaring events
# app.causet
includes:
events: [./events/**/*.events.causet]events:
ARTIST_FOLLOWED:
state: user
entity_expr: event.user_id
payload:
user_id: string
artist_id: stringIn this section
| Page | What it covers |
|---|---|
| Concept | Facts vs commands, global event registry |
| Defining Events | state, entity_expr, payload types, kind |
| Event Naming | Past tense, domain prefixes |
| Event Metadata | Envelope fields and event.ts |
| Dispatching Events | op: emit from rules |
| Event Versioning | Safe schema evolution |
| System Events | Operational event kinds |
| Testing Events | Fixtures and replay in tests |
| Best Practices | Reserved fields, naming mistakes |
| Examples | Concert-domain event catalog |
Next steps
- Replay — ledger as source of truth
- Debugging — Ledger Events — tracing commits
- Intents — write path that emits events
- Defining Events — start here for DSL syntax