MingaEditor.Frontend.Manager.PendingFrame (Minga v0.1.0)

Copy Markdown View Source

Immutable encoded frame retained while frontend transport admission is unwritable.

Summary

Functions

Returns retained encoded bytes.

Returns whether this frame can follow an admitted predecessor without a missing base.

Builds retained frame metadata from one complete encoded transaction.

Types

t()

@type t() :: %MingaEditor.Frontend.Manager.PendingFrame{
  base_frame_seq: non_neg_integer(),
  batch: binary(),
  frame_seq: non_neg_integer(),
  generation: non_neg_integer()
}

Functions

byte_size(pending_frame)

@spec byte_size(t()) :: non_neg_integer()

Returns retained encoded bytes.

follows?(pending_frame1, pending_frame2)

@spec follows?(t(), t()) :: boolean()

Returns whether this frame can follow an admitted predecessor without a missing base.

from_commands(commands)

@spec from_commands([binary()]) ::
  {:ok, t()}
  | {:error, MingaEditor.Frontend.FrameTransaction.validation_error()}

Builds retained frame metadata from one complete encoded transaction.