Documentation
¶
Overview ¶
Package temporal is the Temporal provider for OmniWorkflow. It runs the same generic interpreter as the other providers, but as deterministic Temporal workflow code: a single interpreter workflow walks the Plan wave by wave, dispatching each ready step to an activity that invokes the caller's StepExecutor, and holding gates on a Temporal signal. Callers never write workflow code themselves.
Index ¶
- Constants
- func InterpreterWorkflow(ctx workflow.Context, in interpreterInput) (map[string]bool, error)
- type Config
- type Provider
- func (p *Provider) Cancel(ctx context.Context, id string) error
- func (p *Provider) Close()
- func (p *Provider) Get(ctx context.Context, id string) (*omniworkflow.Run, error)
- func (p *Provider) NewWorker(executor omniworkflow.StepExecutor) omniworkflow.Worker
- func (p *Provider) Signal(ctx context.Context, id string, signal omniworkflow.Signal) error
- func (p *Provider) Start(ctx context.Context, req omniworkflow.StartRequest) (*omniworkflow.Run, error)
Constants ¶
const (
DefaultTaskQueue = "omniworkflow"
)
Defaults.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// HostPort is the Temporal frontend address; empty uses the SDK default
// (127.0.0.1:7233).
HostPort string
// Namespace is the Temporal namespace; empty uses "default".
Namespace string
// TaskQueue is the queue the interpreter workflow and step activity run on;
// empty uses DefaultTaskQueue.
TaskQueue string
}
Config configures a dialed Provider.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is the Temporal implementation of omniworkflow.WorkflowProvider.
func New ¶
New builds a Provider over an existing Temporal client. taskQueue empty uses DefaultTaskQueue.
func NewFromConfig ¶
NewFromConfig dials a Temporal client from cfg and returns a Provider. The caller owns the client's lifecycle via Close.
func (*Provider) Cancel ¶
Cancel requests cancellation of the run. Get then reports StatusCancelled.
func (*Provider) NewWorker ¶
func (p *Provider) NewWorker(executor omniworkflow.StepExecutor) omniworkflow.Worker
NewWorker returns a Worker that registers the interpreter workflow and the step activity (bound to executor) and polls the provider's task queue.
func (*Provider) Signal ¶
Signal delivers a gate approval. The signal name must be ApproveSignal(gateID).
func (*Provider) Start ¶
func (p *Provider) Start(ctx context.Context, req omniworkflow.StartRequest) (*omniworkflow.Run, error)
Start begins the interpreter workflow for req.Plan with workflow ID req.ID. The workflow ID is the idempotency key: starting again while a run with the same ID is open returns the existing run instead of creating a duplicate.