operations

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunWithOperationContext added in v1.1.0

func RunWithOperationContext(ctx context.Context, fn func(ctx context.Context) error) error

Types

type Manager

type Manager interface {
	RegisterHandler(ctx context.Context, handler OperationHandler, ops []core.OpType)
	PrepareOperation(ctx context.Context, op *core.Operation) (*core.PreparedOperation, error)
	RunOperation(ctx context.Context, op *core.PreparedOperation, options ...RunOperationOption) (fftypes.JSONObject, error)
	RetryOperation(ctx context.Context, opID *fftypes.UUID) (*core.Operation, error)
	AddOrReuseOperation(ctx context.Context, op *core.Operation, hooks ...database.PostCompletionHook) error
	SubmitOperationUpdate(update *core.OperationUpdate)
	GetOperationByIDCached(ctx context.Context, opID *fftypes.UUID) (*core.Operation, error)
	ResolveOperationByID(ctx context.Context, opID *fftypes.UUID, op *core.OperationUpdateDTO) error
	Start() error
	WaitStop()
}

func NewOperationsManager

func NewOperationsManager(ctx context.Context, ns string, di database.Plugin, txHelper txcommon.Helper, cacheManager cache.Manager) (Manager, error)

type OperationHandler

type OperationHandler interface {
	core.Named
	PrepareOperation(ctx context.Context, op *core.Operation) (*core.PreparedOperation, error)
	RunOperation(ctx context.Context, op *core.PreparedOperation) (outputs fftypes.JSONObject, complete bool, err error)
	OnOperationUpdate(ctx context.Context, op *core.Operation, update *core.OperationUpdate) error
}

type RunOperationOption

type RunOperationOption int
const (
	RemainPendingOnFailure RunOperationOption = iota
)

Jump to

Keyboard shortcuts

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