Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PeerMessageHandler ¶
type PeerMessageHandler interface {
SendResponse(peer.ID, []gsmsg.GraphSyncResponse, []blocks.Block) <-chan struct{}
}
PeerMessageHandler is an interface that can send a response for a given peer across the network.
type PeerResponseManager ¶
type PeerResponseManager struct {
*peermanager.PeerManager
}
PeerResponseManager manages message queues for peers
func New ¶
func New(ctx context.Context, createPeerSender PeerSenderFactory) *PeerResponseManager
New generates a new peer manager for sending responses
func (*PeerResponseManager) SenderForPeer ¶
func (prm *PeerResponseManager) SenderForPeer(p peer.ID) PeerResponseSender
SenderForPeer returns a response sender to use with the given peer
type PeerResponseSender ¶
type PeerResponseSender interface { peermanager.PeerProcess SendResponse( requestID graphsync.RequestID, link ipld.Link, data []byte, ) SendExtensionData(graphsync.RequestID, graphsync.ExtensionData) FinishRequest(requestID graphsync.RequestID) FinishWithError(requestID graphsync.RequestID, status graphsync.ResponseStatusCode) }
PeerResponseSender handles batching, deduping, and sending responses for a given peer across multiple requests.
func NewResponseSender ¶
func NewResponseSender(ctx context.Context, p peer.ID, peerHandler PeerMessageHandler, ipldBridge ipldbridge.IPLDBridge) PeerResponseSender
NewResponseSender generates a new PeerResponseSender for the given context, peer ID, using the given peer message handler and bridge to IPLD.
type PeerSenderFactory ¶
type PeerSenderFactory func(ctx context.Context, p peer.ID) PeerResponseSender
PeerSenderFactory provides a function that will create a PeerResponseSender.
Click to show internal directories.
Click to hide internal directories.