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 ¶
- Variables
- type Provider
- func (p *Provider) Cancel(_ context.Context, id string) error
- func (p *Provider) Get(_ context.Context, id string) (*omniworkflow.Run, error)
- func (p *Provider) NewWorker(executor omniworkflow.StepExecutor) omniworkflow.Worker
- func (p *Provider) Signal(_ context.Context, id string, signal omniworkflow.Signal) error
- func (p *Provider) Start(_ context.Context, req omniworkflow.StartRequest) (*omniworkflow.Run, error)
Constants ¶
This section is empty.
Variables ¶
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).
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) 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 ¶
Signal approves a waiting gate. The signal name must be ApproveSignal(gateID).
func (*Provider) Start ¶
func (p *Provider) Start(_ context.Context, req omniworkflow.StartRequest) (*omniworkflow.Run, error)
Start begins executing req.Plan. The ID is the idempotency key: starting again with the same ID returns the existing run without relaunching it.