MingaEditor.State.RenderCorrelation (Minga v0.1.0)

Copy Markdown View Source

Immutable Editor-owned render scheduling, keyframe, and receipt-ordering state.

Summary

Functions

Records one accepted asynchronous receipt.

Records a synchronous receipt while preserving monotonic ordering evidence.

Classifies asynchronous receipt ordering and normalizes legacy revision zero.

Clears the scheduled render window while preserving its monotonic identity sequence.

Accepts only delivery for the currently scheduled render window.

Marks a newly ready frontend as requiring a renderer-owned keyframe reset.

Returns the last accepted render receipt revision.

Returns the last accepted renderer frame sequence.

Returns the latest submitted render intent revision.

Returns initial render correlation state.

Returns the semantic identity for the next render window.

Queues a keyframe request for one handoff to the renderer process.

Resets frontend correlation without making an older receipt fresh again.

Admits one render timer or coalesces into the already scheduled timer.

Returns whether a render timer currently owns the throttle window.

Returns the identity of the currently scheduled render window.

Advances the Editor-owned semantic intent revision.

Takes a queued keyframe request so the renderer becomes its sole durable owner.

Returns the current timer reference for cancellation at the Editor boundary.

Types

freshness()

@type freshness() :: {:fresh, non_neg_integer()} | {:stale, freshness_reason()}

freshness_reason()

@type freshness_reason() ::
  :superseded_intent | :stale_receipt_revision | :stale_sequence

t()

@opaque t()

timer_delivery()

@type timer_delivery() :: {:current, t()} | {:stale, t()}

timer_identity()

@opaque timer_identity()

Functions

accept_receipt(correlation, revision, frame_seq)

@spec accept_receipt(t(), non_neg_integer(), non_neg_integer()) :: t()

Records one accepted asynchronous receipt.

accept_synchronous_receipt(correlation, revision, frame_seq)

@spec accept_synchronous_receipt(t(), non_neg_integer(), non_neg_integer()) :: t()

Records a synchronous receipt while preserving monotonic ordering evidence.

classify_receipt(correlation, intent_revision, frame_seq)

@spec classify_receipt(t(), non_neg_integer(), non_neg_integer()) :: freshness()

Classifies asynchronous receipt ordering and normalizes legacy revision zero.

clear_timer(correlation)

@spec clear_timer(t()) :: t()

Clears the scheduled render window while preserving its monotonic identity sequence.

deliver(correlation, arg)

@spec deliver(t(), timer_identity()) :: timer_delivery()

Accepts only delivery for the currently scheduled render window.

frontend_ready(correlation)

@spec frontend_ready(t()) :: t()

Marks a newly ready frontend as requiring a renderer-owned keyframe reset.

last_receipt_revision(render_correlation)

@spec last_receipt_revision(t()) :: non_neg_integer()

Returns the last accepted render receipt revision.

last_receipt_sequence(render_correlation)

@spec last_receipt_sequence(t()) :: non_neg_integer()

Returns the last accepted renderer frame sequence.

latest_intent_revision(render_correlation)

@spec latest_intent_revision(t()) :: non_neg_integer()

Returns the latest submitted render intent revision.

new()

@spec new() :: t()

Returns initial render correlation state.

next_timer_identity(render_correlation)

@spec next_timer_identity(t()) :: timer_identity()

Returns the semantic identity for the next render window.

request_keyframe(correlation)

@spec request_keyframe(t()) :: t()

Queues a keyframe request for one handoff to the renderer process.

reset(correlation)

@spec reset(t()) :: t()

Resets frontend correlation without making an older receipt fresh again.

schedule(correlation, identity, timer)

@spec schedule(t(), timer_identity(), reference()) :: {:scheduled | :coalesced, t()}

Admits one render timer or coalesces into the already scheduled timer.

scheduled?(render_correlation)

@spec scheduled?(t()) :: boolean()

Returns whether a render timer currently owns the throttle window.

scheduled_identity(render_correlation)

@spec scheduled_identity(t()) :: timer_identity() | nil

Returns the identity of the currently scheduled render window.

submit(correlation)

@spec submit(t()) :: {t(), pos_integer()}

Advances the Editor-owned semantic intent revision.

take_keyframe_request(correlation)

@spec take_keyframe_request(t()) :: {boolean(), t()}

Takes a queued keyframe request so the renderer becomes its sole durable owner.

timer_reference(render_correlation)

@spec timer_reference(t()) :: reference() | nil

Returns the current timer reference for cancellation at the Editor boundary.