FixAlchemy.MessageStore behaviour (FIXAlchemy v0.2.2)
View SourceStorage for sent messages so a session can answer a ResendRequest.
Only sessions with :sequence_recovery enabled store anything. Implement
this behaviour and pass the module as :message_store to back a session
with durable storage — recovery across a process restart, rather than only
across a reconnect, requires a store that outlives the client process.
FixAlchemy.MessageStore.Memory is the default: fast, per-session, and
discarded when the session ends.
Summary
Callbacks
Fetch stored messages in the inclusive range, ascending by sequence number.
Record an outbound message under its MsgSeqNum.
Drop everything, as a sequence reset requires.
Types
@type t() :: term()
Callbacks
@callback fetch_range(store :: t(), begin_seq :: pos_integer(), end_seq :: pos_integer()) :: [ {pos_integer(), binary()} ]
Fetch stored messages in the inclusive range, ascending by sequence number.
Missing sequence numbers are simply absent from the result; the caller gap-fills them.
@callback put(store :: t(), seq :: pos_integer(), message :: binary()) :: t()
Record an outbound message under its MsgSeqNum.
Drop everything, as a sequence reset requires.