bqueue

package
v0.5.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const Size = 1000

Size defines the default size of the broadcast queue.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broadcast

type Broadcast struct {
	// The byte encoded transaction data to broadcast.
	TxData []byte
	// The requested transaction hash.
	RequestedTxHash hornet.Hash
	// The IDs of the peers to exclude from broadcasting.
	ExcludePeers map[string]struct{}
}

Broadcast defines a transaction and requested transaction hash which should be broadcasted.

type Queue

type Queue interface {
	// EnqueueForBroadcast enqueues the given broadcast to be sent to all peers.
	EnqueueForBroadcast(b *Broadcast)
	// Run runs the broadcast queue.
	Run(shutdownSignal <-chan struct{})
}

Queue implements a queue which broadcasts its elements to all wanted peers.

func New

func New(manager *peering.Manager, reqQueue rqueue.Queue) Queue

New creates a new Queue.

Jump to

Keyboard shortcuts

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