jobs

package
v0.38.0-preview.0.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

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.BlockExecutionDataEntity
}

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(
	store *cache.ExecutionDataCache,
	fetchTimeout time.Duration,
	highestConsecutiveHeight func() (uint64, error),
) *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