Documentation ¶
Index ¶
- type AsyncLoader
- type PeerHandler
- type RequestManager
- func (rm *RequestManager) ProcessResponses(p peer.ID, responses []gsmsg.GraphSyncResponse, blks []blocks.Block)
- func (rm *RequestManager) SendRequest(ctx context.Context, p peer.ID, root ipld.Link, selector ipld.Node) (<-chan types.ResponseProgress, <-chan error)
- func (rm *RequestManager) SetDelegate(peerHandler PeerHandler)
- func (rm *RequestManager) Shutdown()
- func (rm *RequestManager) Startup()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncLoader ¶
type AsyncLoader interface { StartRequest(requestID gsmsg.GraphSyncRequestID) ProcessResponse(responses map[gsmsg.GraphSyncRequestID]metadata.Metadata, blks []blocks.Block) AsyncLoad(requestID gsmsg.GraphSyncRequestID, link ipld.Link) <-chan types.AsyncLoadResult CompleteResponsesFor(requestID gsmsg.GraphSyncRequestID) CleanupRequest(requestID gsmsg.GraphSyncRequestID) }
AsyncLoader is an interface for loading links asynchronously, returning results as new responses are processed
type PeerHandler ¶
type PeerHandler interface {
SendRequest(p peer.ID, graphSyncRequest gsmsg.GraphSyncRequest)
}
PeerHandler is an interface that can send requests to peers
type RequestManager ¶
type RequestManager struct {
// contains filtered or unexported fields
}
RequestManager tracks outgoing requests and processes incoming reponses to them.
func New ¶
func New(ctx context.Context, asyncLoader AsyncLoader, ipldBridge ipldbridge.IPLDBridge) *RequestManager
New generates a new request manager from a context, network, and selectorQuerier
func (*RequestManager) ProcessResponses ¶
func (rm *RequestManager) ProcessResponses(p peer.ID, responses []gsmsg.GraphSyncResponse, blks []blocks.Block)
ProcessResponses ingests the given responses from the network and and updates the in progress requests based on those responses.
func (*RequestManager) SendRequest ¶
func (rm *RequestManager) SendRequest(ctx context.Context, p peer.ID, root ipld.Link, selector ipld.Node) (<-chan types.ResponseProgress, <-chan error)
SendRequest initiates a new GraphSync request to the given peer.
func (*RequestManager) SetDelegate ¶
func (rm *RequestManager) SetDelegate(peerHandler PeerHandler)
SetDelegate specifies who will send messages out to the internet.
func (*RequestManager) Shutdown ¶
func (rm *RequestManager) Shutdown()
Shutdown ends processing for the want manager.
func (*RequestManager) Startup ¶
func (rm *RequestManager) Startup()
Startup starts processing for the WantManager.