Transport-independent Protocol v1 resume state machine.
The rules are in packages/conformance/README.md; the scenarios in
packages/conformance/protocol.json check them. on_frame/2 returns the
new session and a step: frames to deliver to the application, frames to
send now and frames to send after a delay.
Summary
Functions
The first frame of a connection.
A session resuming from watermark (and conversation_id, when known).
Applies one received frame.
The protocol identifier sent in hello.
A sync from the current watermark.
Types
@type frame() :: map()
@type step() :: %{ deliver: [frame()], send: [frame()], schedule: [{non_neg_integer(), frame()}] }
@type t() :: %ConvergerClient.Protocol.Session{ conversation_id: String.t() | nil, own: MapSet.t(integer()), sync_pending: boolean(), watermark: non_neg_integer() }
Functions
The first frame of a connection.
@spec new(non_neg_integer(), String.t() | nil) :: t()
A session resuming from watermark (and conversation_id, when known).
Applies one received frame.
The protocol identifier sent in hello.
A sync from the current watermark.