client

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: MIT Imports: 17 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWorkflowCanceled = errors.New("workflow canceled")
View Source
var ErrWorkflowTerminated = errors.New("workflow terminated")

Functions

func GetWorkflowResult added in v0.0.4

func GetWorkflowResult[T any](ctx context.Context, c Client, instance *workflow.Instance, timeout time.Duration) (T, error)

GetWorkflowResult gets the workflow result for the given workflow result. It first waits for the workflow to finish or until the given timeout has expired.

Types

type Client

type Client interface {
	CreateWorkflowInstance(ctx context.Context, options WorkflowInstanceOptions, wf workflow.Workflow, args ...interface{}) (*workflow.Instance, error)

	CancelWorkflowInstance(ctx context.Context, instance *workflow.Instance) error

	RemoveWorkflowInstance(ctx context.Context, instance *workflow.Instance) error

	WaitForWorkflowInstance(ctx context.Context, instance *workflow.Instance, timeout time.Duration) error

	SignalWorkflow(ctx context.Context, instanceID string, name string, arg interface{}) error
}

func New

func New(backend backend.Backend) Client

type WorkflowInstanceOptions

type WorkflowInstanceOptions struct {
	InstanceID string
}

Jump to

Keyboard shortcuts

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