executor

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: Apache-2.0, MIT Imports: 18 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockHooks added in v0.10.0

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

BlockHooks run for each block loaded

type Executor added in v0.10.0

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

func NewExecutor(
	manager Manager,
	blockHooks BlockHooks) *Executor

NewExecutor returns a new executor

func (*Executor) ExecuteTask added in v0.10.0

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

type Manager added in v0.10.0

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

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

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