pickup

package
v4.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: BSD-2-Clause, BSD-2-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageRetrievalComms

type MessageRetrievalComms interface {
	GetHost(hostId *id.ID) (*connect.Host, bool)
	RequestMessages(host *connect.Host, message *pb.GetMessages) (
		*pb.GetMessagesResponse, error)
	RequestBatchMessages(host *connect.Host,
		message *pb.GetMessagesBatch) (*pb.GetMessagesResponseBatch, error)
}

type Params

type Params struct {
	// Number of worker threads for retrieving messages from gateways
	NumMessageRetrievalWorkers uint

	// Length of round lookup channel buffer
	LookupRoundsBufferLen uint

	// Maximum number of times a historical round lookup will be attempted
	MaxHistoricalRoundsRetries uint

	// Interval between checking for rounds in UncheckedRoundStore due for a
	// message retrieval retry
	UncheckRoundPeriod time.Duration

	// Toggles if message pickup retrying mechanism if forced
	// by intentionally not looking up messages
	ForceMessagePickupRetry bool

	// Duration to wait before sending on a round times out and a new round is
	// tried
	SendTimeout time.Duration

	// Toggles if historical rounds should always be used
	ForceHistoricalRounds bool

	BatchMessageRetrieval bool
	MaxBatchSize          int
	BatchDelay            int
	BatchPickupTimeout    int
}

Params contains the parameters for the pickup package.

func GetDefaultParams

func GetDefaultParams() Params

GetDefaultParams returns a default set of Params.

func GetParameters

func GetParameters(params string) (Params, error)

GetParameters returns the default Params, or override with given parameters, if set.

func (Params) MarshalJSON

func (p Params) MarshalJSON() ([]byte, error)

MarshalJSON adheres to the json.Marshaler interface.

func (*Params) UnmarshalJSON

func (p *Params) UnmarshalJSON(data []byte) error

UnmarshalJSON adheres to the json.Unmarshaler interface.

type Pickup

type Pickup interface {
	StartProcessors() stoppable.Stoppable
	GetMessagesFromRound(roundID id.Round, identity receptionID.EphemeralIdentity)
}

func NewPickup

func NewPickup(params Params, bundles chan<- message.Bundle,
	sender gateway.Sender, historical rounds.Retriever,
	comms MessageRetrievalComms,
	rng *fastRNG.StreamGenerator, instance RoundGetter,
	session storage.Session) Pickup

type RoundGetter

type RoundGetter interface {
	GetRound(id id.Round) (*pb.RoundInfo, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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