evoq_responder behaviour (evoq v1.14.1)

View Source

Responder behaviour for evoq.

Responders receive hopes (via mesh or hecate:// API), dispatch commands to the local aggregate, and return feedback containing the post-event aggregate state. This enables session-level consistency for RPC.

Naming convention: {command}_responder_v1

Required Callbacks

- hope_type() -> binary() - handle_hope(HopeType, Payload, Metadata) -> {ok, State} | {error, Reason}

Optional Callbacks

- feedback_module() -> module()

Summary

Callbacks

feedback_module/0

(optional)
-callback feedback_module() -> module().

handle_hope/3

-callback handle_hope(HopeType :: binary(), Payload :: map(), Metadata :: map()) ->
                         {ok, State :: term()} | {error, Reason :: term()}.

hope_type/0

-callback hope_type() -> binary().