evoq_emitter behaviour (evoq v1.14.1)
View SourceEmitter behaviour for evoq.
Emitters subscribe to domain events and publish them as integration facts to external transports (pg or mesh). They translate domain events into facts using an evoq_fact module and publish to the target transport.
Emitters live in the source desk -- the desk that processes the command producing the event. They are supervised by the desk supervisor.
Naming convention: emit_{event}_to_{transport}
Required Callbacks
- source_event() -> atom() - fact_module() -> module() - transport() -> pg | mesh - emit(FactType, Payload, Metadata) -> ok | {error, Reason}