workflow

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: MIT Imports: 25 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 ErrActivityAlreadyRegistered added in v0.17.0

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

func (*ErrActivityAlreadyRegistered) Error added in v0.17.0

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

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

func (*ErrWorkflowAlreadyRegistered) Error added in v0.17.0

type ExecutionResult added in v0.0.5

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

type ExecutorCache added in v0.4.1

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

type RegisterConfig struct {
	Name string
}

type RegisterOption added in v0.17.0

type RegisterOption interface {
	// contains filtered or unexported methods
}

func WithName added in v0.17.0

func WithName(name string) RegisterOption

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) (wf.Workflow, error)

func (*Registry) RegisterActivity

func (r *Registry) RegisterActivity(activity wf.Activity, opts ...RegisterOption) error

func (*Registry) RegisterWorkflow

func (r *Registry) RegisterWorkflow(workflow wf.Workflow, opts ...RegisterOption) error

type WorkflowExecutor

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

	Close()
}

func NewExecutor

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

type WorkflowHistoryProvider added in v0.0.9

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