Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PartialRequest ¶
type PartialRequest struct { Peers []peer.ID Keys []cid.Cid }
PartialRequest is represents one slice of an over request split among peers
type SessionRequestSplitter ¶
type SessionRequestSplitter struct {
// contains filtered or unexported fields
}
SessionRequestSplitter track how many duplicate and unique blocks come in and uses that to determine how much to split up each set of wants among peers.
func New ¶
func New(ctx context.Context) *SessionRequestSplitter
New returns a new SessionRequestSplitter.
func (*SessionRequestSplitter) RecordDuplicateBlock ¶
func (srs *SessionRequestSplitter) RecordDuplicateBlock()
RecordDuplicateBlock records the fact that the session received a duplicate block and adjusts split factor as neccesary.
func (*SessionRequestSplitter) RecordUniqueBlock ¶
func (srs *SessionRequestSplitter) RecordUniqueBlock()
RecordUniqueBlock records the fact that the session received unique block and adjusts the split factor as neccesary.
func (*SessionRequestSplitter) SplitRequest ¶
func (srs *SessionRequestSplitter) SplitRequest(peers []peer.ID, ks []cid.Cid) []*PartialRequest
SplitRequest splits a request for the given cids one or more times among the given peers.
Click to show internal directories.
Click to hide internal directories.