GroundPlane.Boundary.Protocol behaviour (GroundPlane Contracts v0.1.0)

Copy Markdown View Source

Behaviour for direct-module boundary dispatch.

Remote transport is intentionally not implemented here. The same envelope and result contracts are used by monolith direct calls so a future transport can be added without changing the plane contracts.

Summary

Callbacks

dispatch(t)

@callback dispatch(GroundPlane.Boundary.Envelope.t()) ::
  {:ok, GroundPlane.Boundary.DispatchResult.t()} | {:error, map()}

Functions

dispatch(handler, envelope)

@spec dispatch(module(), GroundPlane.Boundary.Envelope.t()) ::
  {:ok, GroundPlane.Boundary.DispatchResult.t()} | {:error, term()}