streamseeder

package
v0.0.1-rc Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWrongType        = errors.New("wrong request type")
	ErrWrongSelectorLen = errors.New("wrong event selector length")
	ErrSelectorMismatch = errors.New("session selector mismatch")
	ErrTooManyChunks    = errors.New("too many request chunks")
)

Functions

This section is empty.

Types

type Callbacks

type Callbacks struct {
	ForEachEvent func(start []byte, onEvent func(key hash.Event, event interface{}, size uint64) bool)
}

type Config

type Config struct {
	SenderThreads           int
	MaxSenderTasks          int
	MaxPendingResponsesSize int32
	MaxResponseChunks       uint32
}

func DefaultConfig

func DefaultConfig(scale cachescale.Func) Config

type Peer

type Peer struct {
	ID           string
	SendChunk    func(dagstream.Response, hash.Events) error
	Misbehaviour func(error)
}

type Seeder

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

func New

func New(cfg Config, callbacks Callbacks) *Seeder

func (*Seeder) NotifyRequestReceived

func (s *Seeder) NotifyRequestReceived(peer Peer, r dagstream.Request) (err error, peerErr error)

func (*Seeder) Start

func (s *Seeder) Start()

func (*Seeder) Stop

func (s *Seeder) Stop()

Stop interrupts the seeder, canceling all the pending operations. Stop waits until all the internal goroutines have finished.

func (*Seeder) UnregisterPeer

func (s *Seeder) UnregisterPeer(peer string) error

Jump to

Keyboard shortcuts

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