inprocess

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.2.1

type Config struct {
	Catalog    durable.Catalog
	Snapshots  durable.SnapshotStore
	Projection vfs.Projection
}

Config is the single in-process host config for New.

type MemoryEventLog

type MemoryEventLog struct {
	// contains filtered or unexported fields
}

MemoryEventLog is a channel EventLog with topics events/retry/close.

func NewMemoryEventLog

func NewMemoryEventLog() *MemoryEventLog

NewMemoryEventLog returns an empty EventLog.

func (*MemoryEventLog) Append

func (l *MemoryEventLog) Append(_ context.Context, sessionID durable.SessionID, topic string, ev tacklr.StreamEvent) error

Append implements durable.EventLog.

func (*MemoryEventLog) CloseSession

func (l *MemoryEventLog) CloseSession(_ context.Context, sessionID durable.SessionID) error

CloseSession implements durable.EventLog. It drops the log so a later session can reuse the id and so closed history does not stay in process memory.

func (*MemoryEventLog) EndSubscribers

func (l *MemoryEventLog) EndSubscribers(sessionID durable.SessionID)

EndSubscribers closes live subscribers without deleting the log (cancel).

func (*MemoryEventLog) Head

func (l *MemoryEventLog) Head(_ context.Context, sessionID durable.SessionID) (durable.Seq, error)

Head implements durable.EventLog. Unknown sessions report seq 0 without allocating a log.

func (*MemoryEventLog) Subscribe

func (l *MemoryEventLog) Subscribe(ctx context.Context, sessionID durable.SessionID, after durable.Seq) (<-chan tacklr.StreamEvent, error)

Subscribe implements durable.EventLog. It replays seq > after then tails. Replay is sent after unlocking so a large log cannot deadlock Append.

type MemorySnapshot

type MemorySnapshot struct {
	// contains filtered or unexported fields
}

MemorySnapshot is an in-memory SnapshotStore.

func NewMemorySnapshot

func NewMemorySnapshot() *MemorySnapshot

NewMemorySnapshot returns an empty SnapshotStore.

func (*MemorySnapshot) Delete

func (s *MemorySnapshot) Delete(_ context.Context, sessionID durable.SessionID) error

Delete implements durable.SnapshotStore.

func (*MemorySnapshot) Load

Load implements durable.SnapshotStore.

func (*MemorySnapshot) Save

Save implements durable.SnapshotStore. expected must equal the revision from the last Load (zero if the row does not exist).

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

Runtime is the in-process durable.Runtime: one goroutine per session.

func New

func New(cfg Config) *Runtime

New constructs an in-process Runtime.

func (*Runtime) Cancel

func (r *Runtime) Cancel(ctx context.Context, sessionID durable.SessionID) error

Cancel implements durable.Runtime. It aborts the in-flight turn and stops child sessions. The parent session stays open for a later Prompt.

func (*Runtime) Children

func (r *Runtime) Children(_ context.Context, parent durable.SessionID) ([]durable.SessionID, error)

Children implements durable.Runtime.

func (*Runtime) Close

func (r *Runtime) Close(ctx context.Context, sessionID durable.SessionID) error

Close implements durable.Runtime.

func (*Runtime) CreateSession

func (r *Runtime) CreateSession(ctx context.Context, req durable.CreateSession) (durable.SessionID, error)

CreateSession implements durable.Runtime.

func (*Runtime) Head

func (r *Runtime) Head(ctx context.Context, sessionID durable.SessionID) (durable.Seq, error)

Head is the current EventLog offset (protocol pumps subscribe after this).

func (*Runtime) Prompt

func (r *Runtime) Prompt(ctx context.Context, sessionID durable.SessionID, msg durable.Prompt) error

Prompt implements durable.Runtime.

func (*Runtime) Resume

func (r *Runtime) Resume(ctx context.Context, sessionID durable.SessionID, resume durable.Resume) error

Resume implements durable.Runtime.

func (*Runtime) Status

Status implements durable.Runtime. Yielded children stay running until HITL is resolved (parent-facing in-progress).

func (*Runtime) Subscribe

func (r *Runtime) Subscribe(ctx context.Context, sessionID durable.SessionID, after durable.Seq) (durable.Subscription, error)

Subscribe implements durable.Runtime.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL