Documentation
¶
Overview ¶
Package debug builds the state of an instance for the debugger (DBG-02), reconstructs it at a step of the history (DBG-13), derives the deltas of the live stream (DBG-03) and wakes the live streams of a replica when their instance changed (Hub, DBG-09).
Index ¶
- func Apply(state model.DebugState, delta model.DebugMessage) model.DebugState
- func At(tx *store.Tx, inst store.Instance, seq int64) (model.DebugState, error)
- func Begin(inst model.Instance) model.DebugState
- func Cut(state model.DebugState, limit int) model.DebugState
- func Delta(previous model.DebugState, current model.DebugState, ...) model.DebugMessage
- func Empty(delta model.DebugMessage) bool
- func FirstSeq(tx *store.Tx, inst store.Instance) (int64, error)
- func Live(tx *store.Tx, inst store.Instance, proc *bpmn.Process) (result model.DebugState, err error)
- func Replay(state model.DebugState, activities []model.Activity) model.DebugState
- func Source(d model.EventDescription) model.EventSource
- func Variable(value any, updatedAt time.Time, elementId string, limit int) model.DebugVariable
- type Hub
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
func Apply(state model.DebugState, delta model.DebugMessage) model.DebugState
Apply merges a delta into a state, as clients do (CLI-05).
func At ¶
At reconstructs the state after the activity entry seq from the latest snapshot before it and the entries in between (DBG-13); seq 0 selects the latest entry.
func Begin ¶
func Begin(inst model.Instance) model.DebugState
Begin is the state before the first activity entry of an instance, the start of a replay when no snapshot precedes the step.
func Cut ¶
func Cut(state model.DebugState, limit int) model.DebugState
Cut applies the transfer limit to all values of a state; values that are already cut stay so.
func Delta ¶
func Delta(previous model.DebugState, current model.DebugState, activities []model.Activity) model.DebugMessage
Delta derives a message of the live stream from the state sent last and the current one; it carries the new activity entries and what changed (DBG-03). Fast loops are thereby merged into one delta with the latest values (DBG-10).
func Empty ¶
func Empty(delta model.DebugMessage) bool
Empty reports whether a delta carries nothing.
func FirstSeq ¶
FirstSeq is the earliest step of an instance that can be reconstructed: the beginning while no entry was evicted, otherwise the oldest snapshot (DBG-14). 0 means none.
func Live ¶
func Live(tx *store.Tx, inst store.Instance, proc *bpmn.Process) (result model.DebugState, err error)
Live builds the current state from the runtime state of an instance. Values are complete; Cut limits them for transfer.
func Replay ¶
func Replay(state model.DebugState, activities []model.Activity) model.DebugState
Replay applies activity entries in order to a state (DBG-13). Values the activity log holds cut stay cut; the snapshots hold them complete (DBG-14).
func Source ¶
func Source(d model.EventDescription) model.EventSource
Source describes the event source of a description (DBG-02).
Types ¶
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub tells live debug streams of a replica when their instance changed (DBG-09). The source is the change stream (SYNC-03): Postgres announces changes on commit through LISTEN/NOTIFY, and the outbox is polled as fallback and for SQLite. A wake-up is only a hint; the stream reads the state itself, lost or repeated wake-ups do no harm.