memory

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

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

Executor 工作流执行器

func NewExecutor

func NewExecutor(wfdefine *workflow.Workflow) *Executor

NewExecutor 创建工作流执行器

func (*Executor) Events

func (e *Executor) Events() <-chan *workflow.Event

Events ...

func (*Executor) Execute

func (e *Executor) Execute(ctx context.Context, inputs map[string]any) (*workflow.Result, error)

Execute 执行工作流

type Graph

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

Graph 表示工作流的DAG图结构

func NewGraph

func NewGraph(nodes []workflow.Node, edges []workflow.Edge) *Graph

NewGraph 创建一个新的DAG图

func (*Graph) AreAllDependenciesCompleted

func (g *Graph) AreAllDependenciesCompleted(nodeID string) bool

AreAllDependenciesCompleted 检查节点的所有前置依赖是否已完成

func (*Graph) Dequeue

func (g *Graph) Dequeue() *workflow.Node

Dequeue 获取指定节点

func (*Graph) Enqueue

func (g *Graph) Enqueue(nodeIDs ...string)

Enqueue 添加节点到队列

func (*Graph) Finished

func (g *Graph) Finished() bool

Finished 检查是否所有节点都已完成

func (*Graph) MarkNodeCompleted

func (g *Graph) MarkNodeCompleted(nodeID string)

MarkNodeCompleted 标记节点已完成

func (*Graph) NextNodes

func (g *Graph) NextNodes(nodeID string) []*workflow.Node

NextNodes 获取指定节点的所有后续节点

func (*Graph) StartNodes

func (g *Graph) StartNodes() []*workflow.Node

StartNodes 获取所有入度为0的起始节点

Jump to

Keyboard shortcuts

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