workflows

package
v0.0.0-...-777089b Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultQueue = wflib.QueueDefault
)

Variables

This section is empty.

Functions

func Migrate

func Migrate(root *sconfig.Root, logger *slog.Logger, opts ...MigrateOption) error

Types

type Client

type Client interface {
	CreateWorkflowInstance(ctx context.Context, options client.WorkflowInstanceOptions, workflow wflib.Workflow, args ...any) (*wflib.Instance, error)
	GetWorkflowInstanceState(ctx context.Context, instance *wflib.Instance) (wfcore.WorkflowInstanceState, error)
	GetWorkflowInstanceHistory(ctx context.Context, instance *wflib.Instance, lastSequenceID *int64) ([]*history.Event, error)
}

type MigrateOption

type MigrateOption func(*migrateOptions)

func WithPostgresMigrationDB

func WithPostgresMigrationDB(db *sql.DB) MigrateOption

type Runtime

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

func NewRuntime

func NewRuntime(root *sconfig.Root, telemetry *aptelemetry.Providers, logger *slog.Logger, opts ...RuntimeOption) (*Runtime, error)

func (*Runtime) Backend

func (r *Runtime) Backend() wfbackend.Backend

func (*Runtime) Client

func (r *Runtime) Client() Client

func (*Runtime) Close

func (r *Runtime) Close() error

func (*Runtime) CreateWorkflowInstance

func (r *Runtime) CreateWorkflowInstance(ctx context.Context, options client.WorkflowInstanceOptions, workflow wflib.Workflow, args ...any) (*wflib.Instance, error)

func (*Runtime) DiagnosticBackend

func (r *Runtime) DiagnosticBackend() (diag.Backend, error)

func (*Runtime) GetWorkflowInstanceHistory

func (r *Runtime) GetWorkflowInstanceHistory(ctx context.Context, instance *wflib.Instance, lastSequenceID *int64) ([]*history.Event, error)

func (*Runtime) GetWorkflowInstanceState

func (r *Runtime) GetWorkflowInstanceState(ctx context.Context, instance *wflib.Instance) (wfcore.WorkflowInstanceState, error)

func (*Runtime) Ping

func (r *Runtime) Ping(ctx context.Context) bool

type RuntimeOption

type RuntimeOption func(*runtimeOptions)

func WithPostgresDB

func WithPostgresDB(db *sql.DB) RuntimeOption

type Worker

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

func NewWorker

func NewWorker(runtime *Runtime, options *wfworker.Options) (*Worker, error)

func (*Worker) RegisterActivity

func (w *Worker) RegisterActivity(activity wflib.Activity, opts ...registry.RegisterOption) error

func (*Worker) RegisterWorkflow

func (w *Worker) RegisterWorkflow(workflow wflib.Workflow, opts ...registry.RegisterOption) error

func (*Worker) Start

func (w *Worker) Start(ctx context.Context) error

func (*Worker) WaitForCompletion

func (w *Worker) WaitForCompletion() error

Jump to

Keyboard shortcuts

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