inmemory

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package inmemory is a process-local reference implementation of omniworkflow.WorkflowProvider. It has no durability — state lives in memory and is lost on restart — which is exactly right for its two jobs: running the conformance suite hermetically (no AWS, no Temporal), and giving consumers a fast local provider for their own tests.

It reuses the shared interpreter core and executes wave-by-wave, matching the Step Functions provider's observable semantics so all providers stay interchangeable. It is a reference, not a durable engine; for durable non-AWS/non-Temporal orchestration, wrap an embeddable engine (e.g. durabletask-go) as a separate provider.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoExecutor = errors.New("omniworkflow/inmemory: no executor registered; call NewWorker first")

ErrNoExecutor is returned by Start when no worker/executor has been registered yet (call NewWorker first).

View Source
var ErrNoPendingApproval = errors.New("omniworkflow/inmemory: no gate awaiting this approval")

ErrNoPendingApproval is returned by Signal when no gate is currently awaiting the given approval.

Functions

This section is empty.

Types

type Provider

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

Provider is the in-memory WorkflowProvider.

func New

func New() *Provider

New returns an empty in-memory Provider. Register an executor and start the lifecycle by obtaining a Worker with NewWorker and running it.

func (*Provider) Cancel

func (p *Provider) Cancel(_ context.Context, id string) error

Cancel aborts the run. Get then reports StatusCancelled.

func (*Provider) Get

func (p *Provider) Get(_ context.Context, id string) (*omniworkflow.Run, error)

Get returns the current state of the run.

func (*Provider) NewWorker

func (p *Provider) NewWorker(executor omniworkflow.StepExecutor) omniworkflow.Worker

NewWorker registers executor as the provider's step executor and returns a Worker. Unlike the remote providers there is no polling: the provider drives runs directly in goroutines. The Worker exists to satisfy the interface and to bound run lifecycle — when its Run context is cancelled, all in-flight runs are cancelled.

func (*Provider) Signal

func (p *Provider) Signal(_ context.Context, id string, signal omniworkflow.Signal) error

Signal approves a waiting gate. The signal name must be ApproveSignal(gateID).

func (*Provider) Start

Start begins executing req.Plan. The ID is the idempotency key: starting again with the same ID returns the existing run without relaunching it.

Jump to

Keyboard shortcuts

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