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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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