Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 a unique block and adjusts the split factor as neccesary.
func (*SessionRequestSplitter) SplitRequest ¶
func (srs *SessionRequestSplitter) SplitRequest(optimizedPeers []bssd.OptimizedPeer, ks []cid.Cid) []bssd.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.