weave

package
v0.24.8 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

type Catalog struct {
	*mdl.Modeler     // db output
	Env          Env // generic storage for command processing
	// contains filtered or unexported fields
}

Catalog - receives ephemera from the importer.

func NewCatalog

func NewCatalog(db *sql.DB) *Catalog

func NewCatalogWithWarnings

func NewCatalogWithWarnings(db *sql.DB, run rt.Runtime, warn func(error)) *Catalog

func (*Catalog) AssembleCatalog

func (cat *Catalog) AssembleCatalog() (err error)

walk the domains and run the commands remaining in their queues

func (*Catalog) CurrentScene added in v0.24.8

func (cat *Catalog) CurrentScene() (ret string)

return name of the scene currently being woven. fix: i dont think this should be exposed its only for jess.

func (*Catalog) EnsureScene added in v0.24.8

func (cat *Catalog) EnsureScene(name string) (ret *Domain)

find or create the named domain

func (*Catalog) GetRuntime

func (cat *Catalog) GetRuntime() rt.Runtime

func (*Catalog) NewCounter

func (cat *Catalog) NewCounter(name string) (ret string)

func (*Catalog) SceneBegin added in v0.24.8

func (cat *Catalog) SceneBegin(name string, at compact.Source, exe []rt.Execute) (ret *mdl.Pen, err error)

func (*Catalog) SceneEnd added in v0.24.8

func (cat *Catalog) SceneEnd()

func (*Catalog) Schedule

func (cat *Catalog) Schedule(when weaver.Phase, cb func(weaver.Weaves, rt.Runtime) error) error

func (*Catalog) ScheduleCmd added in v0.24.8

func (cat *Catalog) ScheduleCmd(key typeinfo.Markup, when weaver.Phase, cb func(weaver.Weaves, rt.Runtime) error) error

run the passed function now or in the future.

func (*Catalog) SchedulePos added in v0.24.8

func (cat *Catalog) SchedulePos(pos compact.Source, when weaver.Phase, cb func(weaver.Weaves, rt.Runtime) error) error

run the passed function now or in the future.

func (*Catalog) Step

func (cat *Catalog) Step(pos compact.Source, cb func(weaver.Phase, *mdl.Pen) error) error

used for jess: runs the passed function until it returns true or errors if currently processing, the first step will execute next phase.

type Domain

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

func (*Domain) AddInitialValue added in v0.24.8

func (d *Domain) AddInitialValue(noun, field string, val rt.Assignment)

func (*Domain) Name

func (d *Domain) Name() string

type Env

type Env map[string]any

custom storage for importers ( ie. package story ) alt: could use context and pass through all functions to be more go like.

func (Env) Inc

func (m Env) Inc(name string, inc int) int

can inc with zero to retrieve the current value

type PenCreator added in v0.24.8

type PenCreator interface {
	NewPen(weaver.Phase, compact.Source) *mdl.Pen
}

manufacture a particular weaver for a particular phase and source position

type Processing added in v0.24.8

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

domains are processed one at a time, starting with those which have zero dependencies, ending with those which have the most dependencies.

func (*Processing) RunPhases added in v0.24.8

func (proc *Processing) RunPhases(cp PenCreator) (err error)

func (*Processing) Schedule added in v0.24.8

func (proc *Processing) Schedule(when weaver.Phase, pos compact.Source, req func(weaver.Phase, *mdl.Pen) error) (err error)

queue the scheduled callback for processing.

func (*Processing) UpdatePhase added in v0.24.8

func (proc *Processing) UpdatePhase(cp PenCreator, now weaver.Phase) (err error)

run the passed phase until all scheduled callbacks have finished. error if they didn't finish ( for example, after trying all of them and failing )

type SceneStack added in v0.24.8

type SceneStack []*Domain

tracks the current target of calls to schedule(). ( often two deep: the tapestry domain, . and the domain being processed. )

func (*SceneStack) Pop added in v0.24.8

func (k *SceneStack) Pop() (ret *Domain, okay bool)

return false if empty

func (*SceneStack) Push added in v0.24.8

func (k *SceneStack) Push(d *Domain)

func (*SceneStack) Top added in v0.24.8

func (k *SceneStack) Top() (ret *Domain, okay bool)

Directories

Path Synopsis
Package mdl provides an api for building the database used by the tapestry runtime.
Package mdl provides an api for building the database used by the tapestry runtime.

Jump to

Keyboard shortcuts

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