Help us shape the future of Go! Take the 2026 Go Developer Survey

statecache

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package statecache is a bounded in-memory cache of folded execution states.

Index

Constants

View Source
const DefaultSize = 10000

DefaultSize is the default number of cached executions.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache maps execution ids to states. When full, an arbitrary entry is evicted: a miss only costs a reload.

func New

func New(size int) *Cache

New returns a cache bounded to size entries.

func (*Cache) Drop

func (c *Cache) Drop(execID string)

Drop removes execID.

func (*Cache) Get

func (c *Cache) Get(execID string) (Entry, bool)

Get returns the cached entry of execID.

func (*Cache) Put

func (c *Cache) Put(execID string, e Entry)

Put stores an entry.

type Entry

type Entry struct {
	State *fold.State
	Def   *flow.Flow
}

Entry is one cached state with its definition.

Jump to

Keyboard shortcuts

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