runstate

package
v2.11.4 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package runstate defines the execution-state port used by the runtime.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithPreparedAttempt

func WithPreparedAttempt(attempt exec.DAGRunAttempt) historyStoreOption

WithPreparedAttempt reuses an attempt that was opened by Dagu before runtime execution.

Types

type Attempt

type Attempt interface {
	ID() string
	Open(ctx context.Context) error
	RecordStatus(ctx context.Context, status exec.DAGRunStatus) error
	RecordOutputs(ctx context.Context, outputs *exec.DAGRunOutputs) error
	ReadStatus(ctx context.Context) (*exec.DAGRunStatus, error)
	ReadOutputs(ctx context.Context) (*exec.DAGRunOutputs, error)
	RequestCancel(ctx context.Context) error
	CancelRequested(ctx context.Context) (bool, error)
	ReadStepMessages(ctx context.Context, stepName string) ([]exec.LLMMessage, error)
	WriteStepMessages(ctx context.Context, stepName string, messages []exec.LLMMessage) error
	WorkDir() string
	Close(ctx context.Context) error
}

Attempt records and reads state for a single workflow execution attempt.

type BeginAttemptRequest

type BeginAttemptRequest struct {
	DAG        *core.DAG
	RunID      string
	AttemptID  string
	Retry      bool
	RootDAGRun exec.DAGRunRef
}

BeginAttemptRequest describes the workflow run attempt to open for execution.

type Store

type Store interface {
	BeginAttempt(ctx context.Context, req BeginAttemptRequest) (Attempt, error)
	OpenAttempt(ctx context.Context, ref exec.DAGRunRef) (Attempt, error)
	OpenChildAttempt(ctx context.Context, root exec.DAGRunRef, childRunID string) (Attempt, error)
}

Store opens execution state for workflow runs.

func NewHistoryStore

func NewHistoryStore(store exec.DAGRunStore, opts ...historyStoreOption) Store

NewHistoryStore uses Dagu's run history store as the runtime run-state store.

Directories

Path Synopsis
Package memstore provides an in-memory runtime run-state store.
Package memstore provides an in-memory runtime run-state store.

Jump to

Keyboard shortcuts

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