Versions in this module Expand all Collapse all v0 v0.2.0 Nov 22, 2026 v0.1.0 Sep 6, 2026 Changes in this version + const KindSignal + var ErrBusy = errors.New("event coordinator is already processing a batch") + var ErrDeferred = errors.New("event batch committed and deferred by policy") + var ErrIdle = errors.New("event coordinator has no pending events") + var ErrInterrupted = errors.New("event processing interrupted by an urgent event") + var ErrQueueFull = errors.New("event coordinator pending queue is full") + type Batch struct + Deferred bool + EndVersion uint64 + Events []Event + Items []trajectory.Item + StartVersion uint64 + Triage Triage + func (batch Batch) Contains(kind trajectory.Kind) bool + func (batch Batch) Signalled(eventType string) bool + func (batch Batch) SourceRevision() uint64 + type Config struct + Gate Gate + MaxPendingEvents int + NextID func(prefix string) string + Now func() uint64 + Processor Processor + ReservedInterruptEvents int + Store *trajectory.Store + type Coordinator struct + func New(config Config) (*Coordinator, error) + func (coordinator *Coordinator) Active() bool + func (coordinator *Coordinator) Commit() (Batch, error) + func (coordinator *Coordinator) Deferral() (Deferral, bool) + func (coordinator *Coordinator) Interrupt(cause error) + func (coordinator *Coordinator) Metrics() Metrics + func (coordinator *Coordinator) Pending() int + func (coordinator *Coordinator) RunNext(parent context.Context) (Batch, error) + func (coordinator *Coordinator) Runnable() bool + func (coordinator *Coordinator) SetGate(gate Gate) + func (coordinator *Coordinator) Signal() <-chan struct{} + func (coordinator *Coordinator) Submit(event Event) (string, error) + func (coordinator *Coordinator) SubmitBatch(events []Event) ([]string, error) + func (coordinator *Coordinator) Unacted() int + func (coordinator *Coordinator) Wake(reason string) + type Deferral struct + EndVersion uint64 + Events int + Items int + Reason string + SinceNS uint64 + StartVersion uint64 + type Event struct + AssistantState *trajectory.AssistantState + Channel string + Content string + CorrelationID string + EventID string + InvocationID string + Kind trajectory.Kind + Observation *trajectory.ObservationMeta + OccurredNS uint64 + Priority Priority + Producer trajectory.Producer + Repair *trajectory.RepairState + Source string + SourceRevision uint64 + SupersedesRevision uint64 + ToolPlaceholder *trajectory.ToolPlaceholder + ToolResults []trajectory.ToolResult + Type string + type Gate interface + AdmitRun func(context.Context, Batch) (bool, string) + type GateFunc func(context.Context, Batch) (bool, string) + func (function GateFunc) AdmitRun(ctx context.Context, batch Batch) (bool, string) + type Metrics struct + CommittedBatches uint64 + DeferredBatches uint64 + ParallelRuns uint64 + PendingEvents int + RefusedEvents uint64 + UnactedBatches int + Wakeups uint64 + type Priority string + const PriorityInterrupt + const PriorityParallel + const PriorityRoutine + type Processor interface + Process func(context.Context, Batch) error + type ProcessorFunc func(context.Context, Batch) error + func (function ProcessorFunc) Process(ctx context.Context, batch Batch) error + type Triage string + const TriageCancel + const TriageParallel + const TriageQueue + func TriageOf(priority Priority) Triage