workflow

package
v0.0.0-...-25251a0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWorkflow

func NewWorkflow(workflowFn reflect.Value) *workflow

func Replaying

func Replaying(ctx sync.Context) bool

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 {
	Completed      bool
	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) RegisterWorkflow

func (r *Registry) RegisterWorkflow(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 log.Logger, tracer trace.Tracer, registry *Registry, historyProvider WorkflowHistoryProvider, instance *core.WorkflowInstance, 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