evoq_listener behaviour (evoq v1.14.1)

View Source

Listener behaviour for evoq.

Listeners receive integration facts from external transports (pg or mesh) and dispatch commands to the local aggregate. They are the entry point for cross-domain integration.

Listeners get their own slice directory in the target CMD app, like process managers. This gives filesystem-level discoverability of external integration points.

Naming convention: on_{fact}_from_{transport}_{command}

Required Callbacks

- source_fact() -> binary() - transport() -> pg | mesh - handle_fact(FactType, Payload, Metadata) -> ok | skip | {error, Reason}

Summary

Callbacks

handle_fact/3

-callback handle_fact(FactType :: binary(), Payload :: map(), Metadata :: map()) ->
                         ok | skip | {error, Reason :: term()}.

source_fact/0

-callback source_fact() -> binary().

transport/0

-callback transport() -> pg | mesh.