Appearance
006 — In-process event bus
Context
Domain mutations (claim transfer, verification timeout, superseded ownership) should not own email delivery. Mail failures must not roll back ownership or verification state. See Events & notifications.
Decision
Use an in-process EventBus under apps/server/src/events/ so domain code emits facts and listeners handle side effects. Listeners are registered from domain/cron contexts, handlers are awaited, failures are logged, and there is no durable outbox or message broker.
This keeps the shape of an event-driven boundary without queues for a prototype.
Consequences
- Easy to test with injected mailers; domain transactions stay independent of Resend.
- No cross-isolate or at-least-once delivery guarantees.
- A production system could swap the bus for Queues/outbox while keeping the same event names and payloads.