ExMCP.Server.ReplayCache behaviour (ex_mcp v1.0.0-rc.8)

Copy Markdown View Source

Behaviour for atomically consuming MRTR continuation identifiers.

A replay cache is optional because consuming a token changes ambiguous network failure semantics. Enable one for resumed handlers that may cause side effects; otherwise ExMCP.Server.RequestContext.delivery_semantics is explicitly :at_least_once.

Summary

Callbacks

consume(jti, expires_at, opts)

@callback consume(jti :: String.t(), expires_at :: integer(), opts :: keyword()) ::
  :ok | {:error, :replayed | term()}