processor

package
v0.17.6 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0, MIT Imports: 65 Imported by: 0

Documentation

Index

Constants

View Source
const BuiltinTaskName = "builtin"

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 IndexerProcessors added in v0.10.1

type IndexerProcessors struct {
	TipsetProcessors            map[string]TipSetProcessor
	TipsetsProcessors           map[string]TipSetsProcessor
	ActorProcessors             map[string]ActorProcessor
	ReportProcessors            map[string]ReportProcessor
	PeriodicActorDumpProcessors map[string]PeriodicActorDumpProcessor
}

func MakeProcessors added in v0.10.1

func MakeProcessors(api tasks.DataSource, indexerTasks []string) (*IndexerProcessors, error)

type PeriodicActorDumpProcessor added in v0.17.1

type PeriodicActorDumpProcessor 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.
	ProcessPeriodicActorDump(ctx context.Context, current *types.TipSet, actors tasks.ActorStatesByType) (model.Persistable, *visormodel.ProcessingReport, error)
}

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 New added in v0.10.1

func New(api tasks.DataSource, name string, taskNames []string) (*StateProcessor, error)

func (*StateProcessor) State

func (sp *StateProcessor) State(ctx context.Context, current, executed *types.TipSet, interval int) (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