Durable sequence-number and outbound-message storage contract.
Summary
Callbacks
Fetches the wire bytes stored for seq_num.
Types
@type sequences() :: %{next_in: pos_integer(), next_out: pos_integer()}
Callbacks
@callback commit_outbound( store_ref :: term(), session_id :: term(), seq_num :: pos_integer(), wire :: binary(), next_out :: pos_integer() ) :: :ok | {:error, term()}
@callback get_outbound( store_ref :: term(), session_id :: term(), seq_num :: pos_integer() ) :: {:ok, binary()} | :error
Fetches the wire bytes stored for seq_num.
:error must mean the message was never stored, and nothing else: the resend
path answers it with a SequenceReset-GapFill, telling the counterparty that
sequence number carried no business message. An implementation that cannot
reach its storage must therefore raise rather than report a gap.
@callback save_inbound( store_ref :: term(), session_id :: term(), next_in :: pos_integer() ) :: :ok | {:error, term()}