Noizu.Comms.Channel behaviour (noizu_comms v0.1.0)

Copy Markdown View Source

Behaviour implemented by every channel adapter.

Adapters live in Noizu.Comms with the channel SDKs as optional dependencies (Noizu.Comms.Adapters.*), so a service pulls in only the channels it uses.

render/2 downgrades unsupported features but never drops text.

Summary

Callbacks

capabilities()

@callback capabilities() :: MapSet.t(atom())

configured?()

@callback configured?() :: boolean()

deliver(t, t, opts)

@callback deliver(Noizu.Comms.Target.t(), Noizu.Comms.Message.t(), opts :: keyword()) ::
  {:ok, Noizu.Comms.Receipt.t()} | {:error, Noizu.Comms.Error.t()}

id()

@callback id() :: atom()

render(t, opts)

@callback render(Noizu.Comms.Message.t(), opts :: keyword()) :: term()