Bedrock.DataPlane.CommitProxy.Batch (bedrock v0.5.2)
View SourceRepresents a batch of transactions being processed by the commit proxy.
Summary
Types
@type reply_fn() :: ({:ok, Bedrock.version(), index :: non_neg_integer()} | {:error, :abort} -> :ok)
@type t() :: %Bedrock.DataPlane.CommitProxy.Batch{ buffer: [ {index :: non_neg_integer(), reply_fn(), Bedrock.DataPlane.Transaction.encoded(), Task.t() | nil} ], commit_version: Bedrock.version(), finalized_at: Bedrock.timestamp_in_ms() | nil, last_commit_version: Bedrock.version(), n_transactions: non_neg_integer(), started_at: Bedrock.timestamp_in_ms() }
Functions
@spec add_transaction( t(), Bedrock.DataPlane.Transaction.encoded(), reply_fn(), Task.t() | nil ) :: t()
@spec new_batch( Bedrock.timestamp_in_ms(), last_commit_version :: Bedrock.version(), commit_version :: Bedrock.version() ) :: t()
@spec set_finalized_at(t(), Bedrock.timestamp_in_ms()) :: t()
@spec transaction_count(t()) :: non_neg_integer()
@spec transactions_in_order(t()) :: [ {index :: non_neg_integer(), reply_fn(), Bedrock.DataPlane.Transaction.encoded(), Task.t() | nil} ]