workflow

package
v0.0.0-...-9ed8f83 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCompensation

func AddCompensation(ctx Context, op compensationOp)

func Cancel

func Cancel(ctx Context)

func Compensate

func Compensate(ctx Context) error

func Drain

func Drain(sigCh workflow.ReceiveChannel) int

Types

type CompensationError

type CompensationError struct {
	Errors []error
}

func (*CompensationError) AddError

func (e *CompensationError) AddError(err error)

func (*CompensationError) Error

func (e *CompensationError) Error() string

func (*CompensationError) HasErrors

func (e *CompensationError) HasErrors() bool

type Context

type Context workflow.Context

func NewSaga

func NewSaga(ctx workflow.Context, options SagaOptions) Context

type ReceiveWithTimeoutResult

type ReceiveWithTimeoutResult struct {
	HasTimedOut bool
	IsCancelled bool
}

func ReceiveWithTimeout

func ReceiveWithTimeout(ctx workflow.Context, sigCh workflow.ReceiveChannel, valuePtr interface{}, timeout time.Duration) ReceiveWithTimeoutResult

type SagaOptions

type SagaOptions struct {
	ParallelCompensation bool
	ContinueWithError    bool
}

type Worker

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

Worker is a Worker in the Saga.

func NewWorker

func NewWorker(
	name string,
	cl client.Client,
) *Worker

func (*Worker) AddStep

func (w *Worker) AddStep(
	name string,
	invoke activity,
	compensate activity,
)

func (*Worker) AddWorkflow

func (w *Worker) AddWorkflow(
	name string,
	flow flow,
)

func (*Worker) ExecuteStep

func (w *Worker) ExecuteStep(
	name string,
	options client.StartWorkflowOptions,
)

func (*Worker) ExecuteWorker

func (w *Worker) ExecuteWorker(
	name string,
	options client.StartWorkflowOptions,
)

func (*Worker) GetName

func (w *Worker) GetName() string

Jump to

Keyboard shortcuts

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