basepeerleecher

package
v0.0.0-...-e884aa9 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasePeerLeecher

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

BasePeerLeecher is responsible for scheduling items for retrieval.

func New

New creates an items fetcher to retrieve items chunk-by-chunk. Works only with 1 peer.

func (*BasePeerLeecher) NotifyChunkReceived

func (d *BasePeerLeecher) NotifyChunkReceived(id interface{}) error

NotifyChunkReceived injects new pack infos from a peer

func (*BasePeerLeecher) Start

func (d *BasePeerLeecher) Start()

Start boots up the announcement based synchroniser, accepting and processing fetches until termination requested.

func (*BasePeerLeecher) Stop

func (d *BasePeerLeecher) Stop()

Stop terminates the announcement based synchroniser, canceling all pending operations.

func (*BasePeerLeecher) Stopped

func (d *BasePeerLeecher) Stopped() bool

func (*BasePeerLeecher) Terminate

func (d *BasePeerLeecher) Terminate()

type EpochDownloaderCallbacks

type EpochDownloaderCallbacks struct {
	IsProcessed IsProcessed

	RequestChunks func(maxNum uint32, maxSize uint64, maxChunks uint32) error

	Suspend func() bool

	Done func() bool
}

type EpochDownloaderConfig

type EpochDownloaderConfig struct {
	RecheckInterval        time.Duration
	DefaultChunkItemsNum   uint32
	DefaultChunkItemsSize  uint64
	ParallelChunksDownload int
}

type IsProcessed

type IsProcessed func(id interface{}) bool

Jump to

Keyboard shortcuts

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