processor

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: Apache-2.0, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActorProcessor

type ActorProcessor interface {
	// ProcessActors processes a set of actors. If error is non-nil then the processor encountered a fatal error.
	// Any data returned must be accompanied by a processing report.
	// Implementations of this interface must abort processing when their context is canceled.
	ProcessActors(ctx context.Context, current *types.TipSet, executed *types.TipSet, actors tasks.ActorStateChangeDiff) (model.Persistable, *visormodel.ProcessingReport, error)
}

type Builder

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

func NewBuilder

func NewBuilder(api tasks.DataSource, processorName string) *Builder

NewBuilder returns a Builder used to construct a StateProcessor

func (*Builder) Build

func (spb *Builder) Build() *StateProcessor

func (*Builder) WithActorProcessors

func (spb *Builder) WithActorProcessors(opt map[string]ActorProcessor) *Builder

func (*Builder) WithBuiltinProcessors

func (spb *Builder) WithBuiltinProcessors(opt map[string]ReportProcessor) *Builder

func (*Builder) WithTipSetProcessors

func (spb *Builder) WithTipSetProcessors(opt map[string]TipSetProcessor) *Builder

func (*Builder) WithTipSetsProcessors

func (spb *Builder) WithTipSetsProcessors(opt map[string]TipSetsProcessor) *Builder

type ReportProcessor

type ReportProcessor interface {
	// ProcessTipSet processes a tipset. If error is non-nil then the processor encountered a fatal error.
	// Implementations of this interface must abort processing when their context is canceled.
	ProcessTipSet(ctx context.Context, current *types.TipSet) (visormodel.ProcessingReportList, error)
}

type Result

type Result struct {
	Task        string
	Error       error
	Report      visormodel.ProcessingReportList
	Data        model.Persistable
	StartedAt   time.Time
	CompletedAt time.Time
}

A Result is either some data to persist or an error which indicates that the task did not complete. Partial completions are possibly provided the Data contains a persistable log of the results.

type StateProcessor

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

func (*StateProcessor) State

func (sp *StateProcessor) State(ctx context.Context, current, executed *types.TipSet) (chan *Result, []string)

State executes its configured processors in parallel, processing the state in `current` and `executed. The return channel emits results of the state extraction closing when processing is completed. It is the responsibility of the processors to abort if its context is canceled. A list of all tasks executing is returned.

type TipSetProcessor

type TipSetProcessor interface {
	// ProcessTipSet processes a tipset. If error is non-nil then the processor encountered a fatal error.
	// Any data returned must be accompanied by a processing report.
	// Implementations of this interface must abort processing when their context is canceled.
	ProcessTipSet(ctx context.Context, current *types.TipSet) (model.Persistable, *visormodel.ProcessingReport, error)
}

type TipSetsProcessor

type TipSetsProcessor interface {
	// ProcessTipSets processes sequential tipsts (a parent and a child, or an executed and a current). If error is non-nil then the processor encountered a fatal error.
	// Any data returned must be accompanied by a processing report.
	// Implementations of this interface must abort processing when their context is canceled.
	ProcessTipSets(ctx context.Context, current *types.TipSet, executed *types.TipSet) (model.Persistable, *visormodel.ProcessingReport, error)
}

Jump to

Keyboard shortcuts

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