workflow

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultWorkflowExecutorCacheOptions = WorkflowExecutorCacheOptions{
	CacheDuration: 30 * time.Second,
}

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 added in v0.3.0

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

func (*ErrInvalidActivity) Error added in v0.3.0

func (e *ErrInvalidActivity) Error() string

type ErrInvalidWorkflow added in v0.3.0

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

func (*ErrInvalidWorkflow) Error added in v0.3.0

func (e *ErrInvalidWorkflow) Error() string

type ExecutionResult added in v0.0.5

type ExecutionResult struct {
	Completed      bool
	Executed       []history.Event
	ActivityEvents []history.Event
	TimerEvents    []history.Event
	WorkflowEvents []history.WorkflowEvent
}

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 WorkflowExecutorCache

type WorkflowExecutorCache 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 WorkflowExecutorCacheOptions

type WorkflowExecutorCacheOptions struct {
	// CacheDuration is the duration after which a workflow executor is removed from the cache.
	CacheDuration time.Duration
}

type WorkflowHistoryProvider added in v0.0.9

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

Jump to

Keyboard shortcuts

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