executor

package
v0.13.12 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockHooks

type BlockHooks interface {
	ProcessBlockHooks(p peer.ID, response graphsync.ResponseData, block graphsync.BlockData) hooks.UpdateResult
}

BlockHooks run for each block loaded

type Executor

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

Executor handles actually executing graphsync requests and verifying them. It has control of requests when they are in the "running" state, while the manager is in charge when requests are queued or paused

func NewExecutor

func NewExecutor(
	manager Manager,
	blockHooks BlockHooks) *Executor

NewExecutor returns a new executor

func (*Executor) ExecuteTask

func (e *Executor) ExecuteTask(ctx context.Context, pid peer.ID, task *peertask.Task) bool

type Manager

type Manager interface {
	SendRequest(peer.ID, gsmsg.GraphSyncRequest)
	GetRequestTask(peer.ID, *peertask.Task, chan RequestTask)
	ReleaseRequestTask(peer.ID, *peertask.Task, error)
}

Manager is an interface the Executor uses to interact with the request manager

type ReconciledLoader

type ReconciledLoader interface {
	SetRemoteOnline(online bool)
	RetryLastLoad() types.AsyncLoadResult
	BlockReadOpener(lctx linking.LinkContext, link datamodel.Link) types.AsyncLoadResult
}

ReconciledLoader is an interface that can be used to load blocks from a local store or a remote request

type RequestTask

type RequestTask struct {
	Ctx                  context.Context
	Span                 trace.Span
	Request              gsmsg.GraphSyncRequest
	LastResponse         *atomic.Value
	DoNotSendFirstBlocks int64
	PauseMessages        <-chan struct{}
	Traverser            ipldutil.Traverser
	P                    peer.ID
	InProgressErr        chan error
	Empty                bool
	ReconciledLoader     ReconciledLoader
}

RequestTask are parameters for a single request execution

Jump to

Keyboard shortcuts

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