pushpull

package
v0.22.2-rc.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2020 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultHolder

type DefaultHolder struct {
	// contains filtered or unexported fields
}

func (*DefaultHolder) Add

func (d *DefaultHolder) Add(hash common.Hash128, entry interface{}, highPriority bool)

func (*DefaultHolder) Get

func (d *DefaultHolder) Get(hash common.Hash128) (entry interface{}, highPriority bool, present bool)

func (*DefaultHolder) Has

func (d *DefaultHolder) Has(hash common.Hash128) bool

func (*DefaultHolder) MaxParallelPulls

func (d *DefaultHolder) MaxParallelPulls() uint32

func (*DefaultHolder) PushTracker

func (d *DefaultHolder) PushTracker() PendingPushTracker

func (*DefaultHolder) SupportPendingRequests

func (d *DefaultHolder) SupportPendingRequests() bool

type DefaultPushTracker

type DefaultPushTracker struct {
	// contains filtered or unexported fields
}

func NewDefaultPushTracker

func NewDefaultPushTracker(pullDelay time.Duration) *DefaultPushTracker

func (*DefaultPushTracker) AddPendingPush

func (d *DefaultPushTracker) AddPendingPush(id peer.ID, hash common.Hash128)

func (*DefaultPushTracker) RegisterPull

func (d *DefaultPushTracker) RegisterPull(hash common.Hash128)

func (*DefaultPushTracker) RemovePull

func (d *DefaultPushTracker) RemovePull(hash common.Hash128)

func (*DefaultPushTracker) Requests

func (d *DefaultPushTracker) Requests() chan PendingPulls

func (*DefaultPushTracker) Run

func (d *DefaultPushTracker) Run()

func (*DefaultPushTracker) SetHolder

func (d *DefaultPushTracker) SetHolder(holder Holder)

type Holder

type Holder interface {
	Add(hash common.Hash128, entry interface{}, highPriority bool)
	Has(hash common.Hash128) bool
	Get(hash common.Hash128) (entry interface{}, highPriority bool, present bool)
	MaxParallelPulls() uint32
	SupportPendingRequests() bool
	PushTracker() PendingPushTracker
}

func NewDefaultHolder

func NewDefaultHolder(maxPulls int, pushTracker PendingPushTracker) Holder

type PendingPulls

type PendingPulls struct {
	Id   peer.ID
	Hash common.Hash128
}

type PendingPushTracker

type PendingPushTracker interface {
	RegisterPull(hash common.Hash128)
	AddPendingPush(id peer.ID, hash common.Hash128)
	Requests() chan PendingPulls
	Run()
	SetHolder(holder Holder)
	RemovePull(hash common.Hash128)
}

Jump to

Keyboard shortcuts

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