Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncLoadFn ¶
type AsyncLoadFn func(peer.ID, graphsync.RequestID, ipld.Link, ipld.LinkContext) <-chan types.AsyncLoadResult
AsyncLoadFn is a function which given a request id and an ipld.Link, returns a channel which will eventually return data for the link or an err
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, loader AsyncLoadFn) *Executor
NewExecutor returns a new executor
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 RequestTask ¶ added in v0.10.0
type RequestTask struct { Ctx context.Context Request gsmsg.GraphSyncRequest LastResponse *atomic.Value DoNotSendCids *cid.Set PauseMessages <-chan struct{} Traverser ipldutil.Traverser P peer.ID InProgressErr chan error Empty bool InitialRequest bool }
RequestTask are parameters for a single request execution
Click to show internal directories.
Click to hide internal directories.