sessionrequestsplitter

package
v0.0.0-...-8b9b725 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2019 License: MIT, MIT Imports: 3 Imported by: 4

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL