jobs

package
v0.29.4-with-stacktrace Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: AGPL-3.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockEntry

type BlockEntry struct {
	BlockID       flow.Identifier
	Height        uint64
	ExecutionData *execution_data.BlockExecutionData
}

BlockEntry represents a block that's tracked by the ExecutionDataRequester

func JobToBlockEntry

func JobToBlockEntry(job module.Job) (*BlockEntry, error)

JobToBlockEntry converts a block entry job into its corresponding BlockEntry.

type BlockEntryJob

type BlockEntryJob struct {
	Entry *BlockEntry
}

BlockEntryJob implements the Job interface. It converts a BlockEntry into a Job to be used by job queue.

In current architecture, BlockEntryJob represents a ExecutionData notification enqueued to be processed by the NotificationConsumer that implements the JobQueue interface.

func BlockEntryToJob

func BlockEntryToJob(entry *BlockEntry) *BlockEntryJob

BlockEntryToJob converts the BlockEntry to a BlockEntryJob.

func (BlockEntryJob) ID

func (j BlockEntryJob) ID() module.JobID

ID converts block id into job id, which guarantees uniqueness.

type ExecutionDataReader

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

ExecutionDataReader provides an abstraction for consumers to read blocks as job.

func NewExecutionDataReader

func NewExecutionDataReader(
	downloader execution_data.Downloader,
	headers storage.Headers,
	results storage.ExecutionResults,
	seals storage.Seals,
	fetchTimeout time.Duration,
	highestAvailableHeight func() uint64,
) *ExecutionDataReader

NewExecutionDataReader creates and returns a ExecutionDataReader.

func (*ExecutionDataReader) AddContext

AddContext adds a context to the execution data reader TODO: this is an anti-pattern, refactor this to accept a context in AtIndex instead of storing it on the struct.

func (*ExecutionDataReader) AtIndex

func (r *ExecutionDataReader) AtIndex(height uint64) (module.Job, error)

AtIndex returns the block entry job at the given height, or storage.ErrNotFound. Any other error is unexpected

func (*ExecutionDataReader) Head

func (r *ExecutionDataReader) Head() (uint64, error)

Head returns the highest consecutive block height with downloaded execution data

Jump to

Keyboard shortcuts

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