dagstreamleecher

package
v0.0.0-...-34d0e24 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callbacks

type Callbacks struct {
	IsProcessed func(hash.Event) bool

	RequestChunk func(peer string, r dagstream.Request) error
	Suspend      func(peer string) bool
	PeerEpoch    func(peer string) idx.Epoch
}

type Config

type Config struct {
	Session              basepeerleecher.EpochDownloaderConfig
	RecheckInterval      time.Duration
	BaseProgressWatchdog time.Duration
	BaseSessionWatchdog  time.Duration
	MinSessionRestart    time.Duration
	MaxSessionRestart    time.Duration
}

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns default leecher config

func LiteConfig

func LiteConfig() Config

LiteConfig returns default leecher config for tests

type Leecher

type Leecher struct {
	*basestreamleecher.BaseLeecher
	// contains filtered or unexported fields
}

Leecher is responsible for requesting events based on lexicographic event streams

func New

func New(epoch idx.Epoch, emptyState bool, cfg Config, callback Callbacks) *Leecher

New creates an events downloader to request events based on lexicographic event streams

func (*Leecher) ForceSyncing

func (d *Leecher) ForceSyncing()

func (*Leecher) NotifyChunkReceived

func (d *Leecher) NotifyChunkReceived(sessionID uint32, last hash.Event, done bool) error

func (*Leecher) OnNewEpoch

func (d *Leecher) OnNewEpoch(myEpoch idx.Epoch)

func (*Leecher) Pause

func (d *Leecher) Pause()

func (*Leecher) Resume

func (d *Leecher) Resume()

Jump to

Keyboard shortcuts

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