workflow

package
v0.0.0-...-e49e9a2 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWorkflow

func NewWorkflow(workflowFn reflect.Value) *workflow

Types

type Activity

type Activity interface{}

type ErrInvalidActivity

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

func (*ErrInvalidActivity) Error

func (e *ErrInvalidActivity) Error() string

type ErrInvalidWorkflow

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

func (*ErrInvalidWorkflow) Error

func (e *ErrInvalidWorkflow) Error() string

type ExecutionResult

type ExecutionResult struct {
	State          core.WorkflowInstanceState
	Executed       []*history.Event
	ActivityEvents []*history.Event
	TimerEvents    []*history.Event
	WorkflowEvents []history.WorkflowEvent
}

type ExecutorCache

type ExecutorCache interface {
	Store(ctx context.Context, instance *core.WorkflowInstance, workflow WorkflowExecutor) error
	Get(ctx context.Context, instance *core.WorkflowInstance) (WorkflowExecutor, bool, error)
	StartEviction(ctx context.Context)
}

type Registry

type Registry struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewRegistry

func NewRegistry() *Registry

func (*Registry) GetActivity

func (r *Registry) GetActivity(name string) (interface{}, error)

func (*Registry) GetWorkflow

func (r *Registry) GetWorkflow(name string) (Workflow, error)

func (*Registry) RegisterActivity

func (r *Registry) RegisterActivity(activity interface{}) error

func (*Registry) RegisterActivityByName

func (r *Registry) RegisterActivityByName(name string, activity interface{}) error

func (*Registry) RegisterWorkflow

func (r *Registry) RegisterWorkflow(workflow Workflow) error

func (*Registry) RegisterWorkflowByName

func (r *Registry) RegisterWorkflowByName(name string, workflow Workflow) error

type Workflow

type Workflow interface{}

type WorkflowExecutor

type WorkflowExecutor interface {
	ExecuteTask(ctx context.Context, t *task.Workflow) (*ExecutionResult, error)

	Close()
}

func NewExecutor

func NewExecutor(
	logger *slog.Logger,
	tracer trace.Tracer,
	registry *Registry,
	cv converter.Converter,
	propagators []contextpropagation.ContextPropagator,
	historyProvider WorkflowHistoryProvider,
	instance *core.WorkflowInstance,
	metadata *core.WorkflowMetadata,
	clock clock.Clock,
) (WorkflowExecutor, error)

type WorkflowHistoryProvider

type WorkflowHistoryProvider interface {
	GetWorkflowInstanceHistory(ctx context.Context, instance *core.WorkflowInstance, lastSequenceID *int64) ([]*history.Event, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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