definitions

package
v1.0.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefinitionBatchState added in v0.14.0

type DefinitionBatchState interface {
	// PreFinalize may perform a blocking action (possibly to an external connector) that should execute outside database RunAsGroup
	AddPreFinalize(func(ctx context.Context) error)

	// Finalize may perform final, non-idempotent database operations (such as inserting Events)
	AddFinalize(func(ctx context.Context) error)

	// GetPendingConfirm returns a map of messages are that pending confirmation after already being processed in this batch
	GetPendingConfirm() map[fftypes.UUID]*fftypes.Message
}

DefinitionBatchState tracks the state between definition handlers that run in-line on the pin processing route in the aggregator as part of a batch of pins. They might have complex API calls, and interdependencies, that need to be managed via this state. The actions to be taken at the end of a definition batch. See further notes on "batchState" in the event aggregator

type DefinitionHandlers

type DefinitionHandlers interface {
	privatemessaging.GroupManager

	HandleDefinitionBroadcast(ctx context.Context, state DefinitionBatchState, msg *fftypes.Message, data fftypes.DataArray, tx *fftypes.UUID) (HandlerResult, error)
	SendReply(ctx context.Context, event *fftypes.Event, reply *fftypes.MessageInOut)
}

DefinitionHandlers interface allows components to call broadcast/private messaging functions internally (without import cycles)

type DefinitionMessageAction added in v0.12.0

type DefinitionMessageAction int

DefinitionMessageAction is the action to be taken on an individual definition message

const (
	// ActionReject the message was successfully processed, but was malformed/invalid and should be marked as rejected
	ActionReject DefinitionMessageAction = iota

	// ActionConfirm the message was valid and should be confirmed
	ActionConfirm

	// ActionRetry a recoverable error was encountered - batch should be halted and then re-processed from the start
	ActionRetry

	// ActionWait the message is still awaiting further pieces for aggregation and should be held in pending state
	ActionWait
)

func (DefinitionMessageAction) String added in v0.14.0

func (dma DefinitionMessageAction) String() string

type HandlerResult added in v0.14.0

type HandlerResult struct {
	Action           DefinitionMessageAction
	CustomCorrelator *fftypes.UUID
}

Jump to

Keyboard shortcuts

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