definitions

package
v1.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: Apache-2.0 Imports: 15 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]*core.Message

	// Notify of a DID claim locking in, so a rewind gets queued for it to go back and process any dependent child identities/messages
	DIDClaimConfirmed(did string)
}

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 DefinitionHandler

type DefinitionHandler interface {
	HandleDefinitionBroadcast(ctx context.Context, state DefinitionBatchState, msg *core.Message, data core.DataArray, tx *fftypes.UUID) (HandlerResult, error)
}

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